Skip to content

Conversation

@ndg63276
Copy link
Collaborator

JIRA ticket: LIMS-2041

Summary:

The date-fns-tz library is installed but no longer used, and the date-fns library is only used in a few places to format dates, where native functions can work just as well.

Changes:

  • Remove date-fns and date-fns-tz from package.json
  • Remove the formatDate alias from the webpack config
  • Replace uses of formatDate with native JS functions

To test:

  • Find or create a puck suitable for UDC, eg /containers/cid/349303. Click the Queue button, check the date and time of queueing are displayed in local form, eg 15/01/2026, 16:58:21. (What is saved in the database is current_timestamp, so when you refresh the page you get the PHP version, eg 15-01-2026 16:58)
  • Go to /dewars/registry, and add a new dewar using the form at the bottom, eg DLS-MX-5432. Check it appears in the top half with a Created timestamp in the same form as the other dewars, eg 2026-01-15 17:00:41 (again it is saved in the database as current_timestamp, so it may be slightly different after a refresh)
  • Go to a visits stats page, eg /stats/visit/mx23694-152. Check the date range of the visit is shown at the top right of the page, near the visit breakdown, eg 08/12/2025 - 10/12/2025.
  • Check the same for the beamline stats page eg /runs/overview/bl/i03 has 01/01/2026 - 13/03/2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants