[MGNLUI-3621] Make date picker time zone configurable Created: 08/Oct/15  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: widgets
Affects Version/s: 5.4
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Christian Hamm Assignee: Unassigned
Resolution: Obsolete Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-2694 Dates and times should be displayed i... Closed
duplicate
is duplicated by MGNLUI-6086 DateField handles time zone from user... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

Hi guys,

Is there any possibility that you can make the date picker widget's time zone configurable?

I looked at the code and the default time zone will always have the browsers' time zone offset attached which (for my project) is not desirable. I would be happy if we could just have a toggle that uses the default time zone, or better make it configurable.

info.magnolia.ui.form.field.factory.DateFieldFactory#setTimeZone
    private void setTimeZone(DateField popupDateField) {

        TimeZone timeZone = TimeZone.getDefault();
        try {
            int offset = Page.getCurrent().getWebBrowser().getRawTimezoneOffset();
            timeZone.setRawOffset(offset);
        }
        catch (NullPointerException e) {
            // don't throw null pointer
        }
        popupDateField.setTimeZone(timeZone);
    }

Generated at Mon Feb 12 09:08:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.