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:
@@ -22,7 +22,14 @@ export default function Articles({ initialArticles }: ArticlesProps) {
|
||||
const sessionReadArticleIds = useSignal<Set<string>>(new Set());
|
||||
const isFilterDropdownOpen = useSignal<boolean>(false);
|
||||
|
||||
const dateFormat = new Intl.DateTimeFormat('en-GB', { dateStyle: 'medium' });
|
||||
const dateFormatOptions: Intl.DateTimeFormatOptions = { dateStyle: 'medium' };
|
||||
|
||||
// Force timeZone to UTC for the server rendering
|
||||
if (typeof window === 'undefined') {
|
||||
dateFormatOptions.timeZone = 'UTC';
|
||||
}
|
||||
|
||||
const dateFormat = new Intl.DateTimeFormat('en-GB', dateFormatOptions);
|
||||
|
||||
async function refreshArticles() {
|
||||
if (isRefreshing.value) {
|
||||
|
||||
Reference in New Issue
Block a user