Skip to content

Commit

Permalink
fix: date formatting fix for different time zones
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed May 6, 2024
1 parent 1c07678 commit 54762c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function getActualLanguage(language) {
export function formatDate(date: number | string | dayjs.Dayjs, formatStr: string = 'dddd LT') {
if (date) {
if (!date['format']) {
date = dayjs(date);
date = dayjs.utc(date);
}

if (clock_24 && formatStr.indexOf('LT') >= 0) {
Expand All @@ -137,7 +137,7 @@ export function formatDate(date: number | string | dayjs.Dayjs, formatStr: strin
export function formatTime(date: number | dayjs.Dayjs | string | Date, formatStr: string = 'LT') {
if (date) {
if (!date['format']) {
date = dayjs(date);
date = dayjs.utc(date);
}
if (clock_24 && formatStr === 'LT') {
formatStr = 'HH:mm';
Expand Down

0 comments on commit 54762c6

Please sign in to comment.