-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: incorrect year in showMonthAndYearPickers with locale (#3331)
* fix(date-input): add gregorian year offset to minValue & maxValue * feat(shared-utils): add getGregorianYearOffset * fix(calendar): add gregorian year offset to minValue & maxValue * feat(changeset): add changeset * fix(system): remove defaultDates.minDate and defaultDates.maxDate * fix(calendar): add missing import * feat(date-picker): add test * feat(calendar): add test
- Loading branch information
Showing
8 changed files
with
152 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@nextui-org/calendar": patch | ||
"@nextui-org/date-input": patch | ||
"@nextui-org/system": patch | ||
"@nextui-org/shared-utils": patch | ||
--- | ||
|
||
Fixed incorrect year in `showMonthAndYearPickers` with different locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export function getGregorianYearOffset(identifier: string): number { | ||
switch (identifier) { | ||
case "buddhist": | ||
return 543; | ||
case "ethiopic": | ||
case "ethioaa": | ||
return -8; | ||
case "coptic": | ||
return -284; | ||
case "hebrew": | ||
return 3760; | ||
case "indian": | ||
return -78; | ||
case "islamic-civil": | ||
case "islamic-tbla": | ||
case "islamic-umalqura": | ||
return -579; | ||
case "persian": | ||
return 622; | ||
case "roc": | ||
case "japanese": | ||
case "gregory": | ||
default: | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters