https://github.com/moment/moment Moment.js is a legacy project, now in maintenance mode. In most cases, you should choose a different library. Day.js looks like a good replacement. https://day.js.org/
Created attachment 135495 [details] [review] Bug 30310: Add dayjs v1.11.2
Created attachment 135496 [details] [review] Bug 30310: Add dayjs timezone plugin
Created attachment 135497 [details] [review] Bug 30310: Adjust js-date-format Test plan: Confirm that the test plan from bug 24455 is still passing
Created attachment 135498 [details] [review] Bug 30310: Remove momentjs
Created attachment 135499 [details] [review] Bug 30310: Adjust about page
Created attachment 136507 [details] [review] Bug 30310: Add dayjs v1.11.2 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 136508 [details] [review] Bug 30310: Add dayjs timezone plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 136509 [details] [review] Bug 30310: Adjust js-date-format Test plan: Confirm that the test plan from bug 24455 is still passing Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 136510 [details] [review] Bug 30310: Remove momentjs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 136511 [details] [review] Bug 30310: Adjust about page Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
No regressions found in my testing.. passing to QA
I think I found a bug, it's not working if you modify dateformat. See also https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137212
Created attachment 137676 [details] [review] Bug 30310: Add dayjs timezone plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 137677 [details] [review] Bug 30310: Adjust js-date-format Test plan: Confirm that the test plan from bug 24455 is still passing Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 137678 [details] [review] Bug 30310: Remove momentjs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 137679 [details] [review] Bug 30310: Adjust about page Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
After applying my console has an error: Uncaught TypeError: t is undefined ... dayjs.min_22.0600035.js:1:6455
(In reply to Nick Clemens from comment #17) > After applying my console has an error: > Uncaught TypeError: t is undefined ... dayjs.min_22.0600035.js:1:6455 I tested on Tools > Calendar. In Firefox I have the same error. In Chromium I see: dayjs.min_22.0600054.js:1 Uncaught TypeError: Cannot read properties of undefined (reading '$i')
Hum, I don't recreate, but maybe was it a conflict with bug 30718? Can you try again now that 30718 has been pushed to master?
Created attachment 141859 [details] [review] Bug 30310: Add dayjs timezone plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141860 [details] [review] Bug 30310: Adjust js-date-format Test plan: Confirm that the test plan from bug 24455 is still passing Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141861 [details] [review] Bug 30310: Remove momentjs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 141862 [details] [review] Bug 30310: Adjust about page Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(In reply to Katrin Fischer from comment #18) > (In reply to Nick Clemens from comment #17) > > After applying my console has an error: > > Uncaught TypeError: t is undefined ... dayjs.min_22.0600035.js:1:6455 > > I tested on Tools > Calendar. In Firefox I have the same error. In Chromium > I see: > > dayjs.min_22.0600054.js:1 Uncaught TypeError: Cannot read properties of > undefined (reading '$i') I am sorry, the issue remains for me. Applied patches, restart_all. Tested in a private tab also. Firefox: Uncaught TypeError: t is undefined Chromium: dayjs.min_22.0600075.js:1 Uncaught TypeError: Cannot read properties of undefined (reading '$i')
(In reply to Katrin Fischer from comment #24) > (In reply to Katrin Fischer from comment #18) > > (In reply to Nick Clemens from comment #17) > > > After applying my console has an error: > > > Uncaught TypeError: t is undefined ... dayjs.min_22.0600035.js:1:6455 > > > > I tested on Tools > Calendar. In Firefox I have the same error. In Chromium > > I see: > > > > dayjs.min_22.0600054.js:1 Uncaught TypeError: Cannot read properties of > > undefined (reading '$i') > > I am sorry, the issue remains for me. Applied patches, restart_all. Tested > in a private tab also. > > Firefox: > Uncaught TypeError: t is undefined > > Chromium: > dayjs.min_22.0600075.js:1 Uncaught TypeError: Cannot read properties of > undefined (reading '$i') How? Please provide the steps. I can go to /cgi-bin/koha/tools/holidays.pl and add new holidays, in a private window.
https://staff-bz30310.sandboxes.biblibre.eu It's working for me there.
(In reply to Jonathan Druart from comment #26) > https://staff-bz30310.sandboxes.biblibre.eu > It's working for me there. Locally I just apply patches, the error is in the console on every page - I restarted all, cleared cache, tried private window
(In reply to Nick Clemens from comment #27) > (In reply to Jonathan Druart from comment #26) > > https://staff-bz30310.sandboxes.biblibre.eu > > It's working for me there. > > Locally I just apply patches, the error is in the console on every page - I > restarted all, cleared cache, tried private window Thx Nick, I can confirm I don't see the error on the sandbox, but saw the problem on 2 different occasions in my ktd environment. I am very sure it was reset in between too, but cannot repeat the test right now.
Seeing same warning about Uncaught TypeError: t is undefined
Created attachment 143172 [details] [review] Bug 30310: Add missing utc plugin
(In reply to Jonathan Druart from comment #30) > Created attachment 143172 [details] [review] [review] > Bug 30310: Add missing utc plugin Joubu> The following paths are ignored by one of your .gitignore files: Joubu> koha-tmpl/intranet-tmpl/lib/dayjs/plugin Joubu> Use -f if you really want to add them. Joubu> I have one file that is not committed there Joubu> but it does not appear in git status because "plugin" is in .gitignore
(In reply to Marcel de Rooy from comment #29) > Seeing same warning about Uncaught TypeError: t is undefined Last follow-up clears warning for me.
Should be good now, sorry!
Created attachment 143173 [details] [review] Bug 30310: Add missing utc plugin
How are we doing here.. nearly PQA?
Can this be a candidate for an early push to 23.05 please?
Created attachment 144948 [details] [review] Bug 30310: Replace one more occurrence to moment
Created attachment 144950 [details] [review] Bug 30310: Fix date_to_rfc3339 We need the customParseFormat plugin to provide a custom date format to the dayjs constructor. Found while working on bug 32559, don't remove this function, it will be used later.
Created attachment 144995 [details] [review] Bug 30310: Add dayjs timezone plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 144996 [details] [review] Bug 30310: Adjust js-date-format Test plan: Confirm that the test plan from bug 24455 is still passing Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 144997 [details] [review] Bug 30310: Remove momentjs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 144998 [details] [review] Bug 30310: Adjust about page Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 144999 [details] [review] Bug 30310: Add missing utc plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 145000 [details] [review] Bug 30310: Replace one more occurrence to moment Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 145001 [details] [review] Bug 30310: Fix date_to_rfc3339 We need the customParseFormat plugin to provide a custom date format to the dayjs constructor. Found while working on bug 32559, don't remove this function, it will be used later. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 145097 [details] [review] Bug 30310: Add dayjs timezone plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145098 [details] [review] Bug 30310: Add dayjs timezone plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145099 [details] [review] Bug 30310: Adjust js-date-format Test plan: Confirm that the test plan from bug 24455 is still passing Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145100 [details] [review] Bug 30310: Remove momentjs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145101 [details] [review] Bug 30310: Adjust about page Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145102 [details] [review] Bug 30310: Add missing utc plugin Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145103 [details] [review] Bug 30310: Replace one more occurrence to moment Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 145104 [details] [review] Bug 30310: Fix date_to_rfc3339 We need the customParseFormat plugin to provide a custom date format to the dayjs constructor. Found while working on bug 32559, don't remove this function, it will be used later. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
22.05.x has the dependencies but I am not sure about backporting this at this point in the 22.05.x lifecycle. Won't backport unless convinced otherwise.