mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
8 lines
250 B
TypeScript
8 lines
250 B
TypeScript
export function parseBucketDate(value: string): Date | null {
|
|
const normalized = value.includes('T')
|
|
? value
|
|
: `${value.replace(' ', 'T')}Z`;
|
|
const parsed = new Date(normalized);
|
|
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
}
|