Skip to content

Commit 47e760a

Browse files
authored
Merge pull request #50 from a8cteam51/fix/gh49-start-time-reverts
Now the date will work first time. If you set the start date after th…
2 parents e916783 + ca1d747 commit 47e760a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/blocks/event-info/components/DateTimeGroup.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ const DateTimeGroupNew = ({
8282
return;
8383
}
8484

85-
const newDate =
86-
tempEventDate ||
87-
(isStartChange ? eventStart : eventEnd);
88-
const newTime =
89-
tempEventTime ||
90-
(isStartChange ? eventStart : eventEnd);
85+
// Get the full date time instance from either temp date or time.
86+
const dateInstance = tempEventDate ? tempEventDate : tempEventTime;
87+
88+
// Set the new date and time based on what was changed.
89+
const newDate = tempEventDate || dateInstance || (isStartChange ? eventStart : eventEnd);
90+
const newTime = tempEventTime || dateInstance || (isStartChange ? eventStart : eventEnd);
9191

9292
// Combine the new date and time and convert to a timestamp.
9393
const newDateTime = getTimestamp(

src/classes/class-date-display-formatter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,8 @@ public function render_single_date( $event_date ) {
675675
// For all day events, just show the date (or date range if different days).
676676
if ( ! $same_day ) {
677677
$output .= ' – ' . $end_date . ' ' . SE_Settings::get_all_day_message();
678-
} else {
679-
$output .= ' ' . SE_Settings::get_all_day_message();
678+
} elseif ( ! $this->date_only ) {
679+
$output .= ' ' . SE_Settings::get_all_day_message();
680680
}
681681
} elseif ( $same_day ) {
682682
// Same day event with times.
@@ -703,7 +703,7 @@ public function render_single_date( $event_date ) {
703703
}
704704

705705
// Add timezone if the option is set.
706-
if ( $this->display_timezone ) {
706+
if ( $this->display_timezone && ! $this->time_only && ! $is_all_day ) {
707707
$output .= ' (' . $this->get_timezone_abbreviation() . ')';
708708
}
709709

0 commit comments

Comments
 (0)