avoid double timezone conversion to fix showing the wrong date for faraway spiders and users
This commit is contained in:
@@ -44,7 +44,9 @@ export function formatExtendedDateTime(
|
||||
const timePart = dateOnly ? "" : " 'kl.' HH:mm";
|
||||
const isCurrentYear = parsed.getFullYear() === new Date().getFullYear();
|
||||
const yearPart = (!isCurrentYear || alwaysIncludeYear) ? " yyyy" : "";
|
||||
return formatDate(parsed, `EEEE d. MMMM${yearPart}${timePart}`);
|
||||
const formatStr = `EEEE d. MMMM${yearPart}${timePart}`;
|
||||
const formatted = format(parsed, formatStr, { timeZone, locale: nb });
|
||||
return formatted;
|
||||
}
|
||||
|
||||
export function isTodayOrFuture(
|
||||
|
Reference in New Issue
Block a user