Line data Source code
1 : import * as connection from '@ankoh/dashql-jsonschema/connection.js';
2 :
3 : /**
4 : * Convert Date to ISO 8601 string for JSON schema date-time fields
5 : */
6 1 : export function dateToTimestamp(date: Date | null): string | undefined {
7 1 : if (!date) return undefined;
8 1 : return date.toISOString();
9 1 : }
10 :
11 : /**
12 : * Convert ISO 8601 string to Date
13 : */
14 : export function timestampToDate(timestamp: string | undefined): Date | null {
15 : if (!timestamp) return null;
16 : return new Date(timestamp);
17 : }
|