mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-24 00:43:29 +10:00
fix language difference when printing resume
This commit is contained in:
@@ -28,9 +28,9 @@ export const formatDateString = (date: string | DateRange, formatStr: string): s
|
||||
|
||||
// If `date` is a string
|
||||
if (isString(date)) {
|
||||
if (!dayjs(date).utc().utc().isValid()) return null;
|
||||
if (!dayjs(date).isValid()) return null;
|
||||
|
||||
return dayjs(date).utc().format(formatStr);
|
||||
return dayjs(date).utc(true).format(formatStr);
|
||||
}
|
||||
|
||||
// If `date` is a DateRange
|
||||
@@ -39,8 +39,8 @@ export const formatDateString = (date: string | DateRange, formatStr: string): s
|
||||
if (!dayjs(date.start).isValid()) return null;
|
||||
|
||||
if (!isEmpty(date.end) && dayjs(date.end).isValid()) {
|
||||
return `${dayjs(date.start).format(formatStr)} - ${dayjs(date.end).format(formatStr)}`;
|
||||
return `${dayjs(date.start).utc(true).format(formatStr)} - ${dayjs(date.end).utc(true).format(formatStr)}`;
|
||||
}
|
||||
|
||||
return `${dayjs(date.start).format(formatStr)} - ${presentString}`;
|
||||
return `${dayjs(date.start).utc(true).format(formatStr)} - ${presentString}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user