I am using date-fns
(v3.6.0) to render the month names in a react native app. The Polish ones seem to be different from the usual month names from a Google search/ChatGPT result.
My implementation of the date-fns looks like
<code>export const getMonthName = (date: Date) => {
if (date.getFullYear() === startOfToday().getFullYear()) {
return format(date, 'MMMM', { locale: 'pl' });
} else {
return format(date, 'MMMM yyyy', { locale:'pl' });
}
};
</code>
<code>export const getMonthName = (date: Date) => {
if (date.getFullYear() === startOfToday().getFullYear()) {
return format(date, 'MMMM', { locale: 'pl' });
} else {
return format(date, 'MMMM yyyy', { locale:'pl' });
}
};
</code>
export const getMonthName = (date: Date) => {
if (date.getFullYear() === startOfToday().getFullYear()) {
return format(date, 'MMMM', { locale: 'pl' });
} else {
return format(date, 'MMMM yyyy', { locale:'pl' });
}
};
This returns the month names as
- stycznia
- lutego
- marca
- kwietnia
- maja
- czerwca
- lipca
- sierpnia
- września
…
however the google search for months names in Polish is
- January in Polish is styczeń
- February in Polish is luty
- March in Polish is marzec
- April in Polish is kwiecień
- May in Polish is maj
- June in Polish is czerwiec
- July in Polish is lipiec
- August in Polish is sierpień
- September in Polish is wrzesień
- October in Polish is październik
- November in Polish is listopad
- December in Polish is grudzień
I found out this github link for the issue on the date/fns github repository which says that the month names are now fixed in v3.6.0