Skip to content

Commit

Permalink
Merge pull request #123 from Scille/ms-add-custom-date
Browse files Browse the repository at this point in the history
[MS] Added custom date format
  • Loading branch information
fabienSvtr authored Aug 2, 2024
2 parents 6505f41 + 39e3c61 commit a543a0a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/services/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface TranslationData {
export type Translatable = string | TranslationData;

export type Locale = 'fr-FR' | 'en-US';
export type DateFormat = 'long' | 'short';
export type DateFormat = 'long' | 'short' | 'narrow';

export interface LocaleOption {
key: Locale;
Expand Down Expand Up @@ -99,6 +99,10 @@ function init(config?: I18nConfig): any {
},
datetimeFormats: {
'en-US': {
narrow: {
month: 'short',
year: 'numeric',
},
short: {
year: 'numeric',
month: 'short',
Expand All @@ -114,6 +118,10 @@ function init(config?: I18nConfig): any {
},
},
'fr-FR': {
narrow: {
month: 'short',
year: 'numeric',
},
short: {
year: 'numeric',
month: 'short',
Expand Down

0 comments on commit a543a0a

Please sign in to comment.