mirror of
https://github.com/directus/directus.git
synced 2026-02-04 23:25:01 -05:00
* Add localized-format util * Add active prop to v-input * Add strings for datetime interface * Add overflow-scroll prop to v-menu * Add close-on-content-click prop to v-select * Add datetime interface * Show display value synced with prop * Sync value with prop * Set lang after user hydration * Add NL date-fns lang to test datetime * Fix locale fetching in date-fns * Dont stage value if year isnt fully filled out * Localize date fns based on shared util * Handle type, render type based display * Don't use exact on v-list-item * Pass type to interface on v-form
12 lines
390 B
TypeScript
12 lines
390 B
TypeScript
import formatOriginal from 'date-fns/format';
|
|
import getDateFNSLocale from '@/utils/get-date-fns-locale';
|
|
|
|
type localizedFormat = (...a: Parameters<typeof formatOriginal>) => Promise<string>;
|
|
|
|
export const localizedFormat: localizedFormat = async (date, format, options): Promise<string> => {
|
|
return formatOriginal(date, format, {
|
|
...options,
|
|
locale: await getDateFNSLocale(),
|
|
});
|
|
};
|