Fix timezone display issues with formatted dates
Fixes #88 Also update Deno, hoping it might help with #87, but it's unlikely
This commit is contained in:
@@ -26,14 +26,21 @@ export default function ListFiles(
|
||||
isShowingNotes,
|
||||
}: ListFilesProps,
|
||||
) {
|
||||
const dateFormat = new Intl.DateTimeFormat('en-GB', {
|
||||
const dateFormatOptions: Intl.DateTimeFormatOptions = {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
hour12: false,
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
});
|
||||
};
|
||||
|
||||
// Force timeZone to UTC for the server rendering
|
||||
if (typeof window === 'undefined') {
|
||||
dateFormatOptions.timeZone = 'UTC';
|
||||
}
|
||||
|
||||
const dateFormat = new Intl.DateTimeFormat('en-GB', dateFormatOptions);
|
||||
|
||||
const routePath = isShowingNotes ? 'notes' : 'files';
|
||||
const itemSingleLabel = isShowingNotes ? 'note' : 'file';
|
||||
|
||||
Reference in New Issue
Block a user