-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preserve language tags #1354
preserve language tags #1354
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -663,7 +663,7 @@ test("DateTime.fromObject accepts a locale", () => { | |
|
||
test("DateTime.fromObject accepts a locale with calendar and numbering identifiers", () => { | ||
const res = DateTime.fromObject({}, { locale: "be-u-ca-coptic-nu-mong" }); | ||
expect(res.locale).toBe("be"); | ||
expect(res.locale).toBe("be-u-ca-coptic-nu-mong"); | ||
expect(res.outputCalendar).toBe("coptic"); | ||
expect(res.numberingSystem).toBe("mong"); | ||
}); | ||
|
@@ -677,7 +677,7 @@ test("DateTime.fromObject accepts a locale string with weird junk in it", () => | |
} | ||
); | ||
|
||
expect(res.locale).toBe("be"); | ||
expect(res.locale).toBe("be-u-ca-coptic-ca-islamic"); | ||
|
||
// "coptic" is right, but some versions of Node 10 give "gregory" | ||
expect(res.outputCalendar === "gregory" || res.outputCalendar === "coptic").toBe(true); | ||
|
@@ -695,7 +695,7 @@ test("DateTime.fromObject overrides the locale string with explicit settings", ( | |
} | ||
); | ||
|
||
expect(res.locale).toBe("be"); | ||
expect(res.locale).toBe("be-u-ca-coptic-nu-mong"); | ||
expect(res.outputCalendar).toBe("islamic"); | ||
expect(res.numberingSystem).toBe("thai"); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add a test here where you set the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think this is that test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, ha, you're right. My bad |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can now move this substring into the
catch
. It was only outside of it because we used it in thereturn
.