Fix cache time for 'next day' Formatter setting when closing time after midnight

Created on 10 March 2018, almost 7 years ago
Updated 14 April 2023, over 1 year ago

The module currently allows users to have a slot like 16:00 - 01:00 (closing at 1am the next day).
In that case, the status label is also being shown correctly (if open or closed).
However, the calculation of the caching duration is wrong.

I have fixed this issue for one of my projects and will upload the patch.
However, we probably want to add some tests since the module is gaining quite a lot of complexity.
For local testing, I've used php-timecop to change PHP's date & time.

If you want to use it as well, install the PHP extension and add something like

$new_time = mktime(11, 00, 0, 3, 11, 2018);
timecop_freeze($new_time);

to your Drupal's index.php after the line
$kernel = new DrupalKernel('prod', $autoloader);.

πŸ› Bug report
Status

Fixed

Version

1.3

Component

Code - formatter

Created by

πŸ‡¨πŸ‡­Switzerland dpacassi ZΓΌrich, Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024