Skip to content

Frontend cannot retrieve actual server time zone if system setting is omitted #9164

@GeoSander

Description

@GeoSander

Problem

Image

If the SYSTEM_SERVER_TIMEZONE setting is left empty in the admin page (Settings, not User Interface!), the frontend retrieves that as "null" (a string, not an actual null) when it reads the gnConfig["system.server.timeZone"] setting.

You can tell that this happens by looking at the date time picker, where the label, name and offset for the timezone presets are concatenated, showing "null" as the name:

Image

The Moment.js library on the frontend side converts "null" into a +00:00 timezone (UTC) offset.

However, this may not represent the actual server timezone at all!

Proposal

When the system settings are retrieved from the backend by doing a GET on ../api/site/settings, the backend should set the actual JVM default timezone (as mentioned in the description on the admin page) before returning the response.

-OR-

If the SYSTEM_SERVER_TIMEZONE setting is omitted, the backend should set it to the JVM default timezone when it saves the settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions