diff options
Diffstat (limited to 'modern/src/common/formatter.js')
-rw-r--r-- | modern/src/common/formatter.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js index f8a55da..ad0ffa2 100644 --- a/modern/src/common/formatter.js +++ b/modern/src/common/formatter.js @@ -4,10 +4,10 @@ export const formatBoolean = (value, t) => (value ? t('sharedYes') : t('sharedNo export const formatNumber = (value, precision = 1) => Number(value.toFixed(precision)); -export const formatDate = (value, locale) => new Intl.DateTimeFormat(locale, { +export const formatDate = (value, locale = 'es') => value ? new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short', -}).format(Date.parse(value)); +}).format(new Date(value)) : ''; export const formatPosition = (value, key, t, locale = 'es') => { if (value != null && typeof value === 'object') { |