Skip to content

Default value for datetime is translated to UTC in form element, whereas local-time is expected. #254

@TomvanTilburg-geodan

Description

@TomvanTilburg-geodan

When providing a default value to the Inputs.datetime, it is translated from localtime to UTC time in the input. According to the specs though, the input itself should display local-time. As an effect the result of the input is always off (unless you live at GMT).

Expectd:

viewof newdatetime = Inputs.datetime({value: new Date('2023-06-01T12:00:00')});
newdatetime -> '2023-06-01T12:00:00'

Observed:

viewof newdatetime = Inputs.datetime({value: new Date('2023-06-01T12:00:00')});
newdatetime -> '2023-06-01T10:00:00'

Example can be found in: https://observablehq.com/d/476e59d057eca559

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions