Fix timezone formatting fallback by normalizing timestamps
This commit is contained in:
1 parent
3235ae3789
commit
49cd477991
7 files changed
+15
-9
No files matched your search
@@ -16,7 +16,13 @@ export const getCurrentTimezone = () => {
|
||||
export const formatLocalTime = (timestamp, options = {}) => {
|
||||
if (!timestamp) return 'Never';
|
||||
|
||||
const date = new Date(timestamp);
|
||||
// Normalize timestamp to ISO if backend returned space-separated datetime
|
||||
let ts = timestamp;
|
||||
if (typeof ts === 'string' && ts.includes(' ') && !ts.includes('T')) {
|
||||
ts = ts.replace(' ', 'T') + 'Z';
|
||||
}
|
||||
|
||||
const date = new Date(ts);
|
||||
|
||||
// Try to get server timezone from settings API response (cached in localStorage)
|
||||
let timeZone;
|
||||
|
||||
Reference in new issue
Block a user