Month string placement in date range literals #2825
Unanswered
asieraduriz
asked this question in
General
Replies: 1 comment
-
There are no range formatting functions in You can try using function formatRange(d1, d2, locale) {
return new Intl.DateTimeFormat(locale, {
month: "long",
day: "numeric"
}).formatRange(d1, d2);
}
const start = new Date(2021, 11, 22);
const end = new Date(2021, 11, 28);
console.log(formatRange(start, end, "en")); // December 22 – 28
console.log(formatRange(start, end, "ru")); // 22–28 декабря |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For the english version of:
December 22-28
Wrong russian:
ноября 22-28
Right russian:
22-28 ноября
Is there something in the API that gets two
Date
objects and might return the placement of the month in the appropriate place?Beta Was this translation helpful? Give feedback.
All reactions