diff --git a/babel.config.js b/babel.config.js index b67f02fa534d7..548219255b525 100644 --- a/babel.config.js +++ b/babel.config.js @@ -116,7 +116,7 @@ module.exports = function getBabelConfig(api) { 'babel-plugin-replace-imports', { test: /date-fns-jalali/i, - replacer: 'date-fns-jalali-v3', + replacer: 'date-fns-jalali-v4', // This option is provided by the `patches/babel-plugin-replace-imports@1.0.2.patch` patch filenameIncludes: 'src/AdapterDateFnsJalaliV3/', }, diff --git a/docs/data/date-pickers/calendar-systems/calendar-systems.md b/docs/data/date-pickers/calendar-systems/calendar-systems.md index 34a82fc47d9cb..1e12eccf3d7a3 100644 --- a/docs/data/date-pickers/calendar-systems/calendar-systems.md +++ b/docs/data/date-pickers/calendar-systems/calendar-systems.md @@ -20,16 +20,16 @@ The following demo shows how to use the `date-fns-jalali` adapter: {{"demo": "AdapterJalali.js"}} :::info -Both `date-fns-jalali` major versions (v2.x and v3.x) are supported. +We support `date-fns-jalali` package v2.x, v3.x, and v4.x major versions. -A single adapter cannot work for both `date-fns-jalali` v2.x and v3.x, because the way functions are exported has been changed in v3.x. +A single adapter cannot work for all `date-fns-jalali` versions, because the way functions are exported has been changed in v3.x. -To use `date-fns-jalali` v3.x, you will have to import the adapter from `@mui/x-date-pickers/AdapterDateFnsJalaliV3` instead of `@mui/x-date-pickers/AdapterDateFnsJalali`. +To use `date-fns-jalali` v3.x or v4.x, you will have to import the adapter from `@mui/x-date-pickers/AdapterDateFnsJalaliV3` instead of `@mui/x-date-pickers/AdapterDateFnsJalali`. ```tsx // with date-fns-jalali v2.x import { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalali'; -// with date-fns-jalali v3.x +// with date-fns-jalali v3.x or v4.x import { AdapterDateFnsJalali } from '@mui/x-date-pickers/AdapterDateFnsJalaliV3'; ``` diff --git a/package.json b/package.json index 3a2cbc44a2321..dbd44a15e6518 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "cpy-cli": "^5.0.0", "cross-env": "^7.0.3", "danger": "^12.3.3", - "date-fns-jalali-v3": "npm:date-fns-jalali@3.6.0-1", + "date-fns-jalali-v4": "npm:date-fns-jalali@4.1.0-0", "date-fns-v4": "npm:date-fns@4.1.0", "eslint": "^8.57.1", "eslint-config-airbnb": "^19.0.4", diff --git a/packages/x-date-pickers-pro/package.json b/packages/x-date-pickers-pro/package.json index e0a43fc517ad2..d66d4ffb75a7e 100644 --- a/packages/x-date-pickers-pro/package.json +++ b/packages/x-date-pickers-pro/package.json @@ -57,7 +57,7 @@ "@mui/material": "^5.15.14 || ^6.0.0", "@mui/system": "^5.15.14 || ^6.0.0", "date-fns": "^2.25.0 || ^3.2.0 || ^4.0.0", - "date-fns-jalali": "^2.13.0-0 || ^3.2.0-0", + "date-fns-jalali": "^2.13.0-0 || ^3.2.0-0 || ^4.0.0-0", "dayjs": "^1.10.7", "luxon": "^3.0.2", "moment": "^2.29.4", diff --git a/packages/x-date-pickers/package.json b/packages/x-date-pickers/package.json index 507e3d6679b21..49e8ab2b835cc 100644 --- a/packages/x-date-pickers/package.json +++ b/packages/x-date-pickers/package.json @@ -59,7 +59,7 @@ "@mui/material": "^5.15.14 || ^6.0.0", "@mui/system": "^5.15.14 || ^6.0.0", "date-fns": "^2.25.0 || ^3.2.0 || ^4.0.0", - "date-fns-jalali": "^2.13.0-0 || ^3.2.0-0", + "date-fns-jalali": "^2.13.0-0 || ^3.2.0-0 || ^4.0.0-0", "dayjs": "^1.10.7", "luxon": "^3.0.2", "moment": "^2.29.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f46e8869d98ea..14e053cbe7102 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -218,9 +218,9 @@ importers: danger: specifier: ^12.3.3 version: 12.3.3(encoding@0.1.13) - date-fns-jalali-v3: - specifier: npm:date-fns-jalali@3.6.0-1 - version: date-fns-jalali@3.6.0-1 + date-fns-jalali-v4: + specifier: npm:date-fns-jalali@4.1.0-0 + version: date-fns-jalali@4.1.0-0 date-fns-v4: specifier: npm:date-fns@4.1.0 version: date-fns@4.1.0 @@ -5464,8 +5464,8 @@ packages: resolution: {integrity: sha512-2wz5AOzd3oQ+PnL3E/iKvJZ14i6oTp15sW047ZFCOgM9OSP8ggbb9jm/4SKI8ejdUGH96Krb5dfEQe8zbkVyZw==} engines: {node: '>=0.11'} - date-fns-jalali@3.6.0-1: - resolution: {integrity: sha512-f4FlXArA3kE0uW27y/2AJjRevb6x7DaLMjJfxw7CEXC+XK/JXbZ/WVHND5l1zq2VZsssRrXRWWS0u9NGwawVsQ==} + date-fns-jalali@4.1.0-0: + resolution: {integrity: sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==} date-fns@2.30.0: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} @@ -14673,7 +14673,7 @@ snapshots: dependencies: '@babel/runtime': 7.25.7 - date-fns-jalali@3.6.0-1: {} + date-fns-jalali@4.1.0-0: {} date-fns@2.30.0: dependencies: