Skip to content

DateInput stores wrong date if timezone is +2 #28

@jheiska

Description

@jheiska

When storing a date with dateinput, while local time is ahead of UTC, the time storing is a bit "funny". As it is converted to datetime and to utc, the actual date stored is the day before the selected one, since the time on the date is 0:00 and decreasing it by 2 hours will take it to the previous day.
This causes some serious problems if the date is converted to a date in backend, simply throwing away the time part.
I did find some ways to get around this from react-admin issues, but shouldn't this be something that is resolved in the component itself, maybe as an optional "switch"?

EDIT: Actually, why dateinput doesn't just send a date (like the react-admin basic dateinput), why is the "time" included?
EDIT2: By "switch" I mean for example having an option to choose what timezone the date(or time in datetime) is entered in. If this kind of option exists, I was unable to find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions