/** * Pure date/time helpers for the {@link DatePicker}. * * The picker edits three OpenAPI string formats — `date`, `date-time`, and * `time` — as a small bag of integer fields. Keeping the parse/format logic * here (free of Vue and, where possible, of the ambient timezone) makes it * straightforward to unit test the exact strings we hand back to the request. */ /** The OpenAPI string formats the picker knows how to edit. */ export type DatePickerType = 'date' | 'date-time' | 'time'; /** * A date/time broken into its editable fields. * * `offset` applies to both time and date-time values: it holds the timezone * designator (`Z` or `±HH:MM`) so a round-trip preserves whatever the user * originally typed instead of silently rewriting it to the local zone. */ export type DateParts = { year: number; /** 1-12 (human month, not the 0-based `Date` month) */ month: number; day: number; hour: number; minute: number; second: number; /** Timezone designator, e.g. `Z` or `+02:00`, when present in the original value. */ offset: string; /** Fractional seconds, including the leading decimal point, preserved during edits. */ fraction?: string; }; /** * Parse a formatted value into editable fields, or return `null` when it does * not match the given format. A `null` result is how the picker recognizes * free-text or `{{variable}}` values it should not try to interpret — it just * falls back to "now" for its initial view without touching the field. */ export declare const parseValue: (value: string, type: DatePickerType) => DateParts | null; /** Format the date portion as `YYYY-MM-DD`. */ export declare const formatDate: (parts: DateParts) => string; /** Format the time portion as `HH:MM:SS`. */ export declare const formatTime: (parts: DateParts) => string; /** * Format editable fields back into the string the request expects. * * For `date-time` the caller is responsible for supplying a non-empty * `offset`; use {@link getLocalTimezoneOffset} to derive one when the original * value had none. */ export declare const formatValue: (parts: DateParts, type: DatePickerType) => string; /** * Read the current fields from a `Date`, in the host's local timezone. Used to * seed the picker with "now"/"today" and to fill in an offset when a * `date-time` value arrives without one. */ export declare const partsFromDate: (date: Date) => DateParts; /** * The host's UTC offset for the given date as an RFC 3339 designator * (`+02:00`, `-05:00`, or `+00:00`). `Date.getTimezoneOffset` reports minutes * *behind* UTC, so the sign is inverted here. */ export declare const getLocalTimezoneOffset: (date: Date) => string; /** * Resolve an unzoned selection in the host timezone. If the wall time falls in * a daylight-saving gap, move it forward by the gap so the fields and offset * describe the same instant. */ export declare const resolveLocalDateTime: (parts: DateParts) => DateParts; //# sourceMappingURL=date-parts.d.ts.map