shelving
Version:
Toolkit for using data in JavaScript.
17 lines (16 loc) • 1.02 kB
TypeScript
import { DateSchema, type DateSchemaOptions } from "./DateSchema.js";
/**
* Define a valid UTC date in ISO 8601 format, e.g. `2005-09-12T18:15:00.000Z`
* - The date includes the `Z` suffix to indicate UTC time, this ensures consistent transfer of the date between client and server.
* - If you wish to define an _abstract_ date without a timezone, e.g. a birthday or anniversary, use `DateSchema` instead.
* - If you wish to define an _abstract_ time without a timezone, e.g. a daily alarm, use `TimeSchema` instead.
*/
export declare class DateTimeSchema extends DateSchema {
constructor({ one, title, input, ...options }: DateSchemaOptions);
format(value: Date): string;
stringify(value: Date): string;
}
/** Valid datetime, e.g. `2005-09-12T08:00:00Z` (required because falsy values are invalid). */
export declare const DATETIME: DateTimeSchema;
/** Valid datetime, e.g. `2005-09-12T21:30:00Z`, or `null` */
export declare const NULLABLE_DATETIME: import("./NullableSchema.js").NullableSchema<string>;