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) {
|
||||
|
||||
@@ -57,7 +57,14 @@ export default function Feeds({ initialFeeds }: FeedsProps) {
|
||||
const feeds = useSignal<NewsFeed[]>(initialFeeds);
|
||||
const isOptionsDropdownOpen = useSignal<boolean>(false);
|
||||
|
||||
const dateFormat = new Intl.DateTimeFormat('en-GB', { dateStyle: 'medium', timeStyle: 'short' });
|
||||
const dateFormatOptions: Intl.DateTimeFormatOptions = { dateStyle: 'medium', timeStyle: 'short' };
|
||||
|
||||
// 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 onClickAddFeed() {
|
||||
if (isAdding.value) {
|
||||
|
||||
Reference in New Issue
Block a user