You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I put a date that was invalid for some validator.
Initially it accepted the date (in 2050 because there is no permanent ban) but when I try to edit the shadow ban it shows me this error:
mount-redraw.js:15 RangeError: Invalid time value
at Date.toISOString (<anonymous>)
at p.h.toISOString (dayjs.min.js:1)
at a.e.oninit (BanUserModal.ts:30)
at Function.a (render.js:30)
at M (render.js:917)
at render.js:153
at render.js:160
at l (render.js:66)
at f (render.js:423)
at h (render.js:302)
On this line of code:
if (until) {
// @ts-ignore dayjs type-hints not available
**this.until = dayjs(until).toISOString().substring(0, 16); // Remove timezone and seconds for compatibility with datetime-local**
}
The database shows the banned until as 0000-00-00 00:00:00 so I guess it did not save correctly! Database won't accept 2050 as a date, I think that's the issue, any idea why?
The text was updated successfully, but these errors were encountered:
For now I have just added a validation error message if the date is after 2038-01-19 03:14:07, which is the maximum value for the TIMESTAMP MySQL column used in the database.
I have also fixed the frontend so the interface doesn't break if an invalid value is already in the database.
I'm not actually sure what to do with the column type yet. I see Flarum Suspend uses a DATETIME which can be bigger than 2038, but there's plenty more columns that still use TIMESTAMP in Flarum and will need to be updated in the future.
I'll probably switch all the date columns of all my extensions to DATETIME in one go at some point in the future.
I think using 2038 dates should work as a good enough workaround for now?
I think I put a date that was invalid for some validator.
Initially it accepted the date (in 2050 because there is no permanent ban) but when I try to edit the shadow ban it shows me this error:
On this line of code:
The database shows the banned until as
0000-00-00 00:00:00
so I guess it did not save correctly! Database won't accept 2050 as a date, I think that's the issue, any idea why?The text was updated successfully, but these errors were encountered: