Replies: 1 comment
-
You can access these through the import { frCA } from "date-fns/locale";
const locale = frCA;
const days = [0, 1, 2, 3, 4, 5, 6].map((i) => {
return {
wide: locale.localize.day(i, { width: "wide" }),
abbreviated: locale.localize.day(i, { width: "abbreviated" })
};
});
const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((i) => {
return {
wide: locale.localize.month(i, { width: "wide" }),
abbreviated: locale.localize.month(i, { width: "abbreviated" })
};
});
console.log(days);
console.log(months); |
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
-
Is there a way of extracting the date-fns locale data such as
My use case
Im using the calendar library React native calendars that uses XDate for i18n.
XDate has a more simple locale object than date-fns but does not provide the language data out of the box.
Beta Was this translation helpful? Give feedback.
All reactions