Page MenuHomePhabricator

Add "include timezone" parameter to datetimepicker input
Open, Needs TriagePublic

Description

Adding a {{{field|start|input type=datetimepicker|include timezone|default=2024-09-09T19:00:00+02:00}}} produces

image.png (176×1 px, 36 KB)

Expected Result:
Date is displayed as 19:00:00 CEST or 17:00:00 Z

Actual Result:
Date is displayed as 19:00:00 Z

Version: Page Forms 5.7.2 with MediaWiki 1.39.7

Event Timeline

It's not suprising that this fails for you, because the "datetimepicker" input actually does not support the "include timezone" parameter, unfortunately - only the "datetime" input does. That, in turn, is because the JavaScript widget that "datetimepicker" uses - DateTimeInputWidget from OOUI - doesn't support timezones, other than UTC. So, other than with a hack, I don't think can be done; you might be better off just setting that default value to UTC time, or of course using "datetime" instead.

Yaron_Koren renamed this task from datetimepicker ignores timezone to Add "timezone" parameter to datetimepicker input .Oct 10 2024, 5:20 PM
Yaron_Koren renamed this task from Add "timezone" parameter to datetimepicker input to Add "include timezone" parameter to datetimepicker input .