Skip to content

Date Time Range

Interface

export type IDateTimeRangeTypeValue = {
    start: string;
    end: string;
} | null;
 
export interface IDateTimeRangeField extends CommonField {
    type: 'date-time-range';
    options?: {
        placeholder?: string;
        format?: string;
    };
    private?: () => Promise<IDateTimeRangeTypeValue>;
    render?: (v: IDateTimeRangeTypeValue) => JSX.Element;
    validation?: Validation<IDateTimeRangeTypeValue>;
}

Example

{
  type: 'date-time-range',
  name: 'YOUR_PATH',
  options: {
    placeholder: 'Select a date time range',
    format: 'yyyy-MM-dd'
  },
  validation: z
    .object({
      start: z.string(),
      end: z.string()
    })
}