@tsed/schema
Version:
JsonSchema module for Ts.ED Framework
27 lines (26 loc) • 693 B
JavaScript
import { JsonFormatTypes } from "../domain/JsonFormatTypes.js";
import { from } from "./from.js";
/**
* Declare a new string model with `format: date`.
*
* See @@JsonSchema@@ to discover available methods.
*/
export function date() {
return from(Date).format(JsonFormatTypes.DATE);
}
/**
* Declare a new string model with `format: datetime`.
*
* See @@JsonSchema@@ to discover available methods.
*/
export function datetime() {
return from(Date).format(JsonFormatTypes.DATE_TIME);
}
/**
* Declare a new string model with `format: time`.
*
* See @@JsonSchema@@ to discover available methods.
*/
export function time() {
return from(Date).format(JsonFormatTypes.TIME);
}