fix: Proper processing of date fields (Domain Expiry) with cleanup of unnecessary Date comparison functions#6638
Conversation
Unlike SQLite, MariaDB/MySQL returns dates as strings. This fix converts those strings back to Date objects. Fixes: Domain name xxxxx will expire in NaN days louislam#6618
There was a problem hiding this comment.
That requires fixes/special handling inside RedBean codebase. Until then these fixes are all I can think of.
I think it is because of the assignment. MariaDB do not support well with the yyyy-mm-ddThh:mm:ss+Z format (I don't know the exact name of it)
We should use R.isoDateTimeMillis() to get the format which supported in both databases.
Incorrect assignment examples:
uptime-kuma/server/model/domain_expiry.js
Line 249 in 0eca301
uptime-kuma/server/model/domain_expiry.js
Line 248 in 0eca301
Correct Example:
uptime-kuma/server/model/monitor.js
Line 403 in 0eca301
+ Remove getDaysRemaining/getDaysBetween
# Conflicts: # .eslintrc.js # CONTRIBUTING.md # package-lock.json # package.json # server/util-server.js # src/pages/StatusPage.vue # test/backend-test/test-domain.js
@louislam I have pushed the recommended changes along with some cleanups. Please review again. |
Unlike SQLite, MariaDB/MySQL returns dates as strings. This fix converts those strings back to Date objects.
Fixes: Domain name xxxxx will expire in NaN days #6618