fix: fix property type 'date' when backend returns an iso string
Fixes issue related to https://github.com/SoftwareBrothers/adminjs/issues/1691
@AshotN this fixes a bug where date values were rendered as NaN-NaN-NaN if backend returned an ISO string instead of a simple date string while having the property's type set to date instead of datetime.
Makes sense, I haven't been able to test on my actual project yet. But looking at the changes it looks good to me. Sorry for introducing that issue
I'll have to give this more thought. If the database/backend stores datetimes using UTC timezone and the user's timezone is i.e. GMT+4, this will convert backend's 2024/08/13 11:00PM to 2024-08-13, while that should be 2024-08-14 in the user's timezone.
My thought process was for date's with no time. We should display exactly what the DB is storing, so 2024-01-01 no matter where you are should display 2024-01-01. For editing I can see it either way, if your local timezone should be converted to UTC, or just write it as you input it. The latter is more intuitive at face value. But I'm not sure what people would expect more
Hi there, Upgrading from 7.8.1 to 7.8.12 gave me the NaN-NaN-NaN issue. Waiting for this fix to be deployed. Thanks
I'll merge this for now. We should consider using https://www.npmjs.com/package/@formkit/tempo for dates in the meantime
:tada: This PR is included in version 7.8.13 :tada:
The release is available on:
Your semantic-release bot :package::rocket: