Skip to content

Commit

Permalink
fix: Info.months for Islamic calendar (#1464)
Browse files Browse the repository at this point in the history
Info.months for Islamic has duplicate month "Rabiʻ I" and also Islamic months order is incorrect.

Fixed by changing the year from 2016 to 2009 which is the most recent year that Islamic and Gregorian months were sync.
  • Loading branch information
adotnusiyan committed Aug 9, 2023
1 parent 2411f6e commit f06788b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/impl/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function intlConfigString(localeStr, numberingSystem, outputCalendar) {
function mapMonths(f) {
const ms = [];
for (let i = 1; i <= 12; i++) {
const dt = DateTime.utc(2016, i, 1);
const dt = DateTime.utc(2009, i, 1);
ms.push(f(dt));
}
return ms;
Expand Down
4 changes: 2 additions & 2 deletions test/info/listers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ test("Info.months respects the numbering system", () => {

test("Info.months respects the calendar", () => {
expect(Info.months("long", { locale: "en", outputCalendar: "islamic" })).toEqual([
"Muharram",
"Safar",
"Rabiʻ I",
"Rabiʻ II",
"Jumada I",
Expand All @@ -115,8 +117,6 @@ test("Info.months respects the calendar", () => {
"Shawwal",
"Dhuʻl-Qiʻdah",
"Dhuʻl-Hijjah",
"Safar",
"Rabiʻ I",
]);
});

Expand Down

0 comments on commit f06788b

Please sign in to comment.