I found following fragment in code:
if (!empty($settings['date_single_day']['end_after_midnight'])) {
$start_time = $element['#value']['value']['time'];
$end_time = $element['#value']['value2']['time'];
if ($end_time < $start_time) {
This is resposnsible for adding one day to date. Unfortunately, this is behaving incorrectly. Variables $start_time and $end_time can be in 12 hours format (ie 06pm and 11am).
This code compares time lexically, not time-aware. In our example
'06pm' < '11am', while in 24 hour format it's identical to 18 < 11 which is obviously wrong. This makes "end after midnight" completely unusable.
I prepared patch for that issue, it solved problem for me.
Comments
Comment #2
jsobiecki commentedPatch in attachment
Comment #3
jsobiecki commentedComment #4
troybthompson commentedThis solved problems I was having with it showing nodes spanning two days when I had a start time before noon. Thanks!
Comment #5
adarkling commentedstrtotime conversion is the correct way to compare dates.
Patch applied properly.
RTBC
Comment #6
jgullstr commentedCommited, thanks!
Comment #9
calefilm commentedThank you, kindly, for the patch!