Fix timezones
This commit is contained in:
@@ -68,7 +68,11 @@ export function formatElapsedTime(utcTimestamp: string): string {
|
||||
* @returns formatted datetime string
|
||||
*/
|
||||
export function formatDateTime(date: Date | string): string {
|
||||
const d = typeof date === 'string' ? new Date(date) : date;
|
||||
let dateToParse = date;
|
||||
if (typeof date === 'string' && !date.endsWith('Z') && !date.includes('+')) {
|
||||
dateToParse = date + 'Z';
|
||||
}
|
||||
const d = typeof dateToParse === 'string' ? new Date(dateToParse) : dateToParse;
|
||||
return d.toLocaleString('sv-SE', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
|
||||
Reference in New Issue
Block a user