Skip to content

Commit

Permalink
Bump date-fns to 3.6.0 (#2844)
Browse files Browse the repository at this point in the history
* Bump date-fns to 3.6.0

* Review how specific lang is loaded
  • Loading branch information
xavierfacq authored May 7, 2024
1 parent 19beddd commit bf8642e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
33 changes: 21 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@react-icons/all-files": "^4.1.0",
"axios": "^1.6.8",
"bootstrap": "^5.3.3",
"date-fns": "^2.30.0",
"date-fns": "^3.6.0",
"flexsearch": "^0.7.43",
"gatsby": "^5.13.4",
"gatsby-adapter-netlify": "^1.1.4",
Expand Down
5 changes: 3 additions & 2 deletions src/components/VersionSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { useStaticQuery, graphql } from 'gatsby';
import { Trans, useI18next } from 'gatsby-plugin-react-i18next'
import { useLocation } from '@gatsbyjs/reach-router';
import queryString from 'query-string';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DesktopDatePicker } from '@mui/x-date-pickers/DesktopDatePicker';
import * as Locales from 'date-fns/locale';

import { setURLParam } from '../../util/setURLParam';

Expand Down Expand Up @@ -40,7 +41,7 @@ const VersionSelector = ({updater, releaseType, Table}) => {

// import the correct date locale for the language
if (language !== 'en') {
locale = require(`date-fns/locale/${language}/index.js`);
locale = Locales[language] ?? Locales[language.substring(0, 2)] ?? Locales.enUS
}

let selectedVersion = defaultVersion
Expand Down

0 comments on commit bf8642e

Please sign in to comment.