mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
15 lines
365 B
TypeScript
15 lines
365 B
TypeScript
export const getLocalizedMonthYearString = (
|
|
month: number,
|
|
year: number,
|
|
locale: string
|
|
) => {
|
|
const dateForLocalization = new Date();
|
|
dateForLocalization.setDate(1);
|
|
dateForLocalization.setMonth(month - 1);
|
|
dateForLocalization.setFullYear(year);
|
|
return dateForLocalization.toLocaleString(locale, {
|
|
month: "long",
|
|
year: "numeric",
|
|
});
|
|
};
|