Initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { Locale } from 'date-fns';
|
||||
import * as locales from 'date-fns/locale';
|
||||
import type { IntlDateDisplayFormatEnum } from '../constants';
|
||||
|
||||
export type IntlDateLocaleCode = keyof typeof locales;
|
||||
export type IntlDateLanguage = string;
|
||||
|
||||
export type IntlDateLocaleMap = Partial<Record<IntlDateLanguage, IntlDateLocaleConfig>>;
|
||||
|
||||
export type IntlDateLocaleConfig = {
|
||||
code: IntlDateLocaleCode;
|
||||
locale?: Locale;
|
||||
displayFormats?: Partial<Record<IntlDateDisplayFormatEnum, string>>;
|
||||
};
|
||||
|
||||
export function getLocale(lang: IntlDateLocaleCode): Locale {
|
||||
return locales[lang];
|
||||
}
|
||||
Reference in New Issue
Block a user