Problem/Motivation
I installed the Module and activate it but when check my Date-Field in my view there is no new option
by the Displayformat
Steps to reproduce
Install and activate Module, create new View with a date-field
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 7a6d2c3f6a003509188ae9b93f2651ef.png | 23.63 KB | levmyshkin |
| #8 | ae3c89f7f7159b5414064a62c78ad134.png | 53.88 KB | levmyshkin |
| noformat.png | 89 KB | tehmilcho |
Comments
Comment #2
tehmilcho commentedHey... I played bit more around so it seems to work with plane datefield but not when i wanna use a timespan filed with start / end time and date and time.
Comment #3
tehmilcho commentedhey i changed now:
in FlipDownFormatter.php
and added "Datarange" and also added "Datarange" in flipdown.views.inc .. now i pick the format in my View it also will show kind of correct .. so JS script is loaded the counter counts etc but the time is off by 2 Hours .. my Server, PHP, Durpal all is set to "Berlin" as timezone but the Module gives back:
UTC Timestamp: 1753822800 (2025-07-29T23:00:00+02:00)
Instead of "2025-07-30T01:00:00+02:00". Unfortunately i dont have real clue about Drupal DEV or PHP .. i just messaround with AI and good luck. Maybe some else can give a hint what is going with the Timezone here?!
Comment #4
levmyshkinI need to investigate this situation with Timezone, it's not clear for me now where is source of truth for timezone. It can be changed on Server, Sitewide, User specific, Field Storage/Instance/Formatter specific.
Comment #5
tehmilcho commentedHey,
first thank you for looking in to it, i really appreciate it :)
I messed bit more around with AI and found a Soultion?!... its just code from ChatGPT but it seems to work now.
Change:
File: FlipDownFormatter.php
Original Code:
Replacement:
Comment #6
levmyshkinI thought about different cases. If you are only one editor on the site, than Sitewide timezone will work fine. But if you have events in different cities and users will add own events, when it will be needed to get timezone from User settings. I will try to add your snippet and add User specific timezone first. Also it's possible to extend Field Formatter settings and add setting for timezone in it.
Another option, we need to select in field formatter Start or End date to display countdown. And maybe to add setting to display Countdown for both Start and End date.
Comment #8
levmyshkinHi tehmilcho, thank you for your research, I added your snippets in 1.0.1 release. Dates are stored as UTC in Drupal database, but it doesn't use Sitewide timezone to bring it in UTC. It uses User timezone:
/admin/config/regional/settings

/user/1/edit

And I think it's OK for count down functionality when User and Sitewide timezone are the same. But I still need to investigate how to display it right for the case when User have different timezone, than Sitewide. Maybe it's already OK for this case too. I close this ticket for now and continue investigation by myself.
Comment #9
levmyshkinComment #10
levmyshkin