Should displaying a date w/ time field from a CMS collection using the ‘Long Date Time’ format show the seconds?
Product:
Wix Studio
What are you trying to achieve:
We have a collection that has a Date field with the ‘Include Time Field’ option checked. When entering dates & times, we are able to choose from some preset times or type our own. But on the CMS item page, when trying to display the date and time from the ‘Date’ field, and setting this to display with ‘Long Date Time’ as the format, the time displayed includes seconds, even though we don’t enter seconds when adding the times.
According to the documentation (see here), ‘Long date time’ should NOT show the seconds.
So is the documentation incorrect, or are we setting something wrong here?
We really would like the dates to display like they show in docs for ‘Long date time’, but seconds (which always show as ‘00’) just makes it less elegant and more difficult to read. These are for events will be taking place around Southern California, and we tend to round arrival times to 15-minute increments (traffic ;), DEFINITELY not to the second!!!
There are often reports of bugs related to date display in Wix, so this might also be a bug. What I saw before was an issue where the displayed date was one day earlier than expected. In your case, I think you can display the date text without any problems by controlling the date display using Velo code. Manually handling JavaScript date objects can lead to mistakes, so I suggest having ChatGPT or another tool write the conversion code for you—it’s a simple way to handle it. Personally, I find that AI rarely makes mistakes when it comes to template tasks like date calculations. Converting times to 15-minute increments shouldn’t be too difficult either.
I filed a bug report, but just heard back from Wix Support that it is not viewed as a bug. He said he would forward on to appropriate department, but I wouldn’t assume that Wix would be correcting this (at least any time soon). It may even have something to do with underlying restrictions or standards of javascript date display, not sure?!?
I’m pretty sure the date could be parsed and formatted properly in Velo with a bunch of javascript, but didn’t want to go there for just this issue. It’s unfortunate, as it does make the times harder to read at quick glance, but so be it for now…
The ‘Long Date Time’ format should ideally omit seconds for cleaner display, especially if they’re not relevant. Perhaps Wix could update the formatting options to give us a bit more control over this for event listings like yours.
The documentation shows ‘Long date time’ as February 25, 2019 at 8:45:00 PM which includes seconds, so I think this is expected behaviour.
I’ve passed the feedback along. In the meantime, and I understand not an ideal solution, but you could have 2 text boxes in a horizontal stack. The first displaying a long date in the format February 25, 2019 and the second with a Medium time (12h) in the format 8:45 PM
Combining February 25, 2019 and 8:45 PM next to each other would visually read asFebruary 25, 2019 8:45 PM
Thanks for the response. It does look like the documentation has been updated since I made my support ticket, so that will at least be less confusing for others in the future.
And am trying the combined stack of different displayed dates/times as suggested. It’s cumbersome to put together, and will require some CSS to allow the line to break properly, but it does appear to allow greater flexibility in the display using what we have to work with.