chore: update French i18n (#5561)
This commit is contained in:
1 parent
ba140a05f7
commit
181c0f32c5
185 files changed
+2779
-374
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import moment from 'moment';
|
||||
import i18n from 'i18next';
|
||||
|
||||
/**
|
||||
* Formats DICOM date.
|
||||
*
|
||||
* @param {string} date
|
||||
* @param {string} strFormat
|
||||
* @returns {string} formatted date.
|
||||
*/
|
||||
export function formatDICOMDate(date: string, strFormat?: string): string {
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const format = strFormat ?? i18n.t('Common:localDateFormat', 'MMM D, YYYY');
|
||||
const locale = i18n.language || 'en';
|
||||
const parsed = moment(date, ['YYYYMMDD', 'YYYY.MM.DD'], true);
|
||||
|
||||
if (!parsed.isValid()) {
|
||||
return moment(date).locale(locale).format(format);
|
||||
}
|
||||
|
||||
return parsed.locale(locale).format(format);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { getToggledClassName } from './getToggledClassName';
|
||||
import roundNumber from './roundNumber';
|
||||
import { cn } from '../lib/utils';
|
||||
import { formatDICOMDate } from './formatDICOMDate';
|
||||
|
||||
export { getToggledClassName, roundNumber, cn };
|
||||
export { getToggledClassName, roundNumber, cn, formatDICOMDate };
|
||||
Reference in new issue
Block a user