@intility/bifrost-react-datepicker
Version:
React detepicker for Intility's design system, Bifrost.
27 lines (26 loc) • 725 B
JavaScript
import { enGB } from "date-fns/locale/en-GB";
// we have opted to use en-us spelling for words but en-gb for date format
// because the vast majority of bifrost users are european and expect
// * date to come before month
// * first day of the week to be monday
const datepickerFormat = {
year: "yyyy",
monthYear: "MM/yyyy",
date: "dd/MM/yyyy",
time: "HH:mm",
dateTime: "dd/MM/yyyy HH:mm"
};
const datepickerPlaceholder = {
year: "YYYY",
monthYear: "MM/YYYY",
date: "DD/MM/YYYY",
time: "HH:MM",
dateTime: "DD/MM/YYYY HH:MM"
};
const enGbLocale = {
locale: enGB,
// https://date-fns.org/v2.29.3/docs/format
format: datepickerFormat,
placeholder: datepickerPlaceholder
};
export default enGbLocale;