Bug 30310 - Replace Moment.js with Day.js
Summary: Replace Moment.js with Day.js
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 30718 24455
Blocks: 31149
  Show dependency treegraph
 
Reported: 2022-03-17 15:03 UTC by Jonathan Druart
Modified: 2022-08-19 11:52 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 30310: Add dayjs v1.11.2 (13.85 KB, patch)
2022-05-31 13:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Add dayjs timezone plugin (5.20 KB, patch)
2022-05-31 13:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Adjust js-date-format (4.36 KB, patch)
2022-05-31 13:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Remove momentjs (170.34 KB, patch)
2022-05-31 13:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Adjust about page (1.49 KB, patch)
2022-05-31 13:14 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Add dayjs v1.11.2 (13.91 KB, patch)
2022-06-24 14:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30310: Add dayjs timezone plugin (5.26 KB, patch)
2022-06-24 14:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30310: Adjust js-date-format (4.42 KB, patch)
2022-06-24 14:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30310: Remove momentjs (170.39 KB, patch)
2022-06-24 14:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30310: Adjust about page (1.55 KB, patch)
2022-06-24 14:49 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 30310: Add dayjs timezone plugin (5.26 KB, patch)
2022-07-13 06:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Adjust js-date-format (4.37 KB, patch)
2022-07-13 06:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Remove momentjs (170.40 KB, patch)
2022-07-13 06:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30310: Adjust about page (1.55 KB, patch)
2022-07-13 06:59 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2022-03-17 15:03:24 UTC
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/
Comment 1 Jonathan Druart 2022-05-31 13:14:14 UTC
Created attachment 135495 [details] [review]
Bug 30310: Add dayjs v1.11.2
Comment 2 Jonathan Druart 2022-05-31 13:14:18 UTC
Created attachment 135496 [details] [review]
Bug 30310: Add dayjs timezone plugin
Comment 3 Jonathan Druart 2022-05-31 13:14:22 UTC
Created attachment 135497 [details] [review]
Bug 30310: Adjust js-date-format

Test plan:
Confirm that the test plan from bug 24455 is still passing
Comment 4 Jonathan Druart 2022-05-31 13:14:27 UTC
Created attachment 135498 [details] [review]
Bug 30310: Remove momentjs
Comment 5 Jonathan Druart 2022-05-31 13:14:32 UTC
Created attachment 135499 [details] [review]
Bug 30310: Adjust about page
Comment 6 Martin Renvoize 2022-06-24 14:49:24 UTC
Created attachment 136507 [details] [review]
Bug 30310: Add dayjs v1.11.2

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-06-24 14:49:28 UTC
Created attachment 136508 [details] [review]
Bug 30310: Add dayjs timezone plugin

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2022-06-24 14:49:33 UTC
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>
Comment 9 Martin Renvoize 2022-06-24 14:49:37 UTC
Created attachment 136510 [details] [review]
Bug 30310: Remove momentjs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2022-06-24 14:49:42 UTC
Created attachment 136511 [details] [review]
Bug 30310: Adjust about page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2022-06-24 14:51:03 UTC
No regressions found in my testing.. passing to QA
Comment 12 Jonathan Druart 2022-07-06 14:40:14 UTC
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
Comment 13 Jonathan Druart 2022-07-13 06:59:39 UTC
Created attachment 137676 [details] [review]
Bug 30310: Add dayjs timezone plugin

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Jonathan Druart 2022-07-13 06:59:44 UTC
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>
Comment 15 Jonathan Druart 2022-07-13 06:59:48 UTC
Created attachment 137678 [details] [review]
Bug 30310: Remove momentjs

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 16 Jonathan Druart 2022-07-13 06:59:53 UTC
Created attachment 137679 [details] [review]
Bug 30310: Adjust about page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Nick Clemens 2022-08-19 11:52:38 UTC
After applying my console has an error:
Uncaught TypeError: t is undefined ... dayjs.min_22.0600035.js:1:6455