Date schema type.

Hierarchy (View Summary)

Constructors

  • SchemaType constructor.

    Parameters

    • name: string = ''
    • Optionaloptions: { default?: Date | () => Date; required?: boolean }

    Returns default

Properties

default: () => Date
name: string = ''
options: { default?: Date | () => Date; required: boolean }
q$exists: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks the existance of data.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

q$max: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks whether value is less than or equal to (i.e. <=) the query.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

q$min: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks whether value is greater than or equal to (i.e. >=) the query.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

Methods

  • Casts data.

    Parameters

    • value_: string | number | Date

    Returns Date

  • Casts data.

    Parameters

    • Optionalvalue_: unknown

    Returns Date

  • Compares between two dates.

    Parameters

    • Optionala: Date
    • Optionalb: Date

    Returns number

  • Checks the equality of data.

    Parameters

    • value: Date
    • query: Date

    Returns boolean

  • Parses data and transforms it into a date object.

    Parameters

    • value: string | number | Date

    Returns Date

  • Parses data and transforms it into a date object.

    Returns undefined

  • Finds data by its date.

    Parameters

    • value: Date
    • query: number

    Returns boolean

  • Checks the existance of data.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is greater than (i.e. >) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is greater than or equal to (i.e. >=) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is equal to one of elements in query.

    Parameters

    • value: unknown
    • query: unknown[]
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is less than (i.e. <) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is less than or equal to (i.e. <=) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Finds data by its month. (Start from 0)

    Parameters

    • value: Date
    • query: number

    Returns boolean

  • Checks the equality of data. Returns true if the value doesn't match.

    Parameters

    • value: Date
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is not equal to any elements in query.

    Parameters

    • value: unknown
    • query: unknown[]
    • Optionaldata: unknown

    Returns boolean

  • Finds data by its year. (4-digit)

    Parameters

    • value: Date
    • query: number

    Returns boolean

  • Subtracts milliseconds from date.

    Parameters

    • value: Date
    • update: number

    Returns Date

  • Adds milliseconds to date.

    Parameters

    • value: Date
    • update: number

    Returns Date

  • Renames a field.

    Parameters

    • value: unknown
    • update: string
    • data: unknown

    Returns void

  • Sets the value.

    Type Parameters

    • T

    Parameters

    • value: unknown
    • update: T
    • Optionaldata: unknown

    Returns T

  • Unsets the value.

    Type Parameters

    • T

    Parameters

    • value: T
    • update: boolean
    • Optionaldata: unknown

    Returns T

  • Validates data.

    Parameters

    • value_: unknown
    • Optionaldata: unknown

    Returns Date

  • Transforms a date object to a string.

    Parameters

    • value: Date

    Returns string

  • Transforms a date object to a string.

    Returns undefined