Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: date with no time format should not convert to local timezone #1691

Closed
AshotN opened this issue Jul 31, 2024 · 0 comments · Fixed by #1692
Closed

[Bug]: date with no time format should not convert to local timezone #1691

AshotN opened this issue Jul 31, 2024 · 0 comments · Fixed by #1692
Labels
bug Something isn't working

Comments

@AshotN
Copy link
Contributor

AshotN commented Jul 31, 2024

Contact Details

No response

What happened?

The issue is when an adapter passes a value such as '2024-07-31' to AdminJS, the frontend will display it in local time(2024-07-30). Causing the UI to not match what the database is actually storing.

I propose fixing this by modifying this file (https://github.com/SoftwareBrothers/adminjs/blob/master/src/frontend/components/property-type/datetime/map-value.ts#L9)

Adding a check like this would resolve the problem

const date = propertyType === 'date' ? new Date(`${value}T00:00:00`) : new Date(value)

Semi-Related: #978

Bug prevalence

Always

AdminJS dependencies version

"adminjs": "7.8.7",

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant