Fixed Dateinputrow not observing user timezone

Snog

Well-known member
Affected version
2.0 Beta 6
If you have a value for a timestamp, the template date function displays it properly for the user's timezone, however the date picker does not.

Example (timestamp is 1398830400 - the date shown as the value (2014-04-30) is converted by the date function - timezone: Eastern (US/Canada)):

badtimezone.webp

Template code:
Code:
<xf:dateinputrow name="dateline" label="Start date" value="{{ date($value.dateline,'Y-m-d') }}" />
 
Last edited:
This may or may not still be a bug.

But I was able to get the correct display by using the default date format for the site this is on. (just using date($value.dateline))
 
This is due to the specification for <input type="date" />, where the expected format is always yyyy-mm-dd, so there's not a lot we can do there, it's just how it works.
 
Hmm.. I swear that's what's in the input box, but not what's displayed in the selection dropdown. The dropdown is showing the UTC time for the input box.

Either way, it works with the other date calc as I said.
 
Top Bottom