Fix timezone issue by providing default 'UTC' value

Co-authored-by: estruyf <2900833+estruyf@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-03 15:02:31 +00:00
parent de569d37d5
commit 17f390545a
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ export class PanelSettings {
},
date: {
format: Settings.get<string>(SETTING_DATE_FORMAT) || '',
timezone: Settings.get<string>(SETTING_GLOBAL_TIMEZONE) || ''
timezone: Settings.get<string>(SETTING_GLOBAL_TIMEZONE) || 'UTC'
},
tags: (await TaxonomyHelper.get(TaxonomyType.Tag)) || [],
categories: (await TaxonomyHelper.get(TaxonomyType.Category)) || [],

View File

@@ -2,6 +2,6 @@ import { SETTING_GLOBAL_TIMEZONE } from '../constants';
import { DateHelper, Settings } from '../helpers';
export const formatInTimezone = (date: Date, dateFormat: string) => {
const timezone = Settings.get<string>(SETTING_GLOBAL_TIMEZONE);
const timezone = Settings.get<string>(SETTING_GLOBAL_TIMEZONE) || 'UTC';
return DateHelper.formatInTimezone(date, dateFormat, timezone) || '';
};