- First commit to issue fork.
- @bbu23 opened merge request.
- Status changed to Needs review
over 1 year ago 7:37pm 23 February 2023 - π·π΄Romania bbu23
Not sure exactly why the "single" option was removed, but the problem comes from this:
if (!array_key_exists($delta, $elements)) { // No end date provided or end date equals start date use single formatting. $single_format = $this->getSetting('single'); $elements[$delta] = ['#markup' => \Drupal::service('date.formatter')->format($start_date, 'custom', t($single_format))]; }
When the single option was removed, there was still this piece of code that was trying to get that setting and use it. I've replaced that with one_day, but also removed the
if ($start_date !== $end_date) {
earlier in the execution. Not sure why that "if" is needed, so please correct me if I'm wrong, but in that "if" we have the following:if (date('d.m.Y', $start_date) === date('d.m.Y', $end_date)) { $format = $this->getSetting('one_day'); }
So, if the start date and end date are equal, this line is never reached. This is why I removed it because if they're equal, it should go through the one_day setting (unless there's something I don't see).
- Status changed to Closed: duplicate
over 1 year ago 4:08pm 8 June 2023 - πΊπΈUnited States jeffam
There's a patch in π Passing empty value to t() when same day + time for start and end date RTBC that prevents the error, but doesn't quite fix the formatting issue.