API Reference

SchemaType.Date Class

Defined in lib/types/date.js:4
Extends SchemaType

Description

Schema type: Date.

Constructor

SchemaType.Date

([options])
Defined in lib/types/date.js:4

Schema type: Date.

Parameters

Methods

cast

(value) Date
Inherited from SchemaType but overwritten in: lib/types/date.js:42

Casts the given value to a date object.

Parameters

  • value Any

Returns

checkRequired

(value) Boolean
Inherited from SchemaType but overwritten in: lib/types/date.js:30

Checks if the given value is a date object.

Parameters

  • value Any

Returns

compare

(data, value) Boolean
Inherited from SchemaType but overwritten in: lib/types/date.js:83

Compares data.

Parameters

Returns

q$day

(data, value) Boolean

Checks whether data is at the specific day.

Parameters

Returns

q$exists

(data, value) Boolean
Inherited from : lib/schematype.js:126

Checks whether the field exists.

q$exists is also aliased as q$exist.

Parameters

  • data Any
  • value Any

Returns

q$gt

(data, value) Boolean
Inherited from : lib/schematype.js:182

Checks whether data is greater than value.

Parameters

  • data Any
  • value Any

Returns

q$gte

(data, value) Boolean
Inherited from : lib/schematype.js:195

Checks whether data is greater than or equal to value.

q$gte is also aliased as q$min.

Parameters

  • data Any
  • value Any

Returns

q$in

(data, value) Boolean
Inherited from : lib/schematype.js:210

Checks whether data contains value.

Parameters

  • data Any
  • value Any

Returns

q$lt

(data, value) Boolean
Inherited from : lib/schematype.js:154

Checks whether data is less than value.

Parameters

  • data Any
  • value Any

Returns

q$lte

(data, value) Boolean
Inherited from : lib/schematype.js:167

Checks whether data is less than or equal to value.

q$lte is also aliased as q$max.

Parameters

  • data Any
  • value Any

Returns

q$month

(data, value) Boolean

Checks whether data is in the specific month.

Parameters

Returns

q$ne

(data, value) Boolean
Inherited from : lib/schematype.js:141

Checks whether data is equal to value. If not, return true.

Parameters

  • data Any
  • value Any

Returns

q$nin

(data, value) Boolean
Inherited from : lib/schematype.js:229

Checks whether data not contains value.

Parameters

  • data Any
  • value Any

Returns

q$where

(data, value) Boolean
Inherited from : lib/schematype.js:274

Validates data with value function.

Parameters

Returns

q$within

(data, value) Boolean
Inherited from : lib/schematype.js:248

Checks whether data is between value.

Parameters

Returns

q$without

(data, value) Boolean
Inherited from : lib/schematype.js:261

Checks whether data is not between value.

Parameters

Returns

q$year

(data, value) Boolean

Checks whether data is in the specific year.

Parameters

Returns

save

(value) Number
Inherited from SchemaType but overwritten in: lib/types/date.js:71

Transforms a date object into a number.

Parameters

Returns

u$dec

(data, value) Date

Substracts value from data.

Parameters

Returns

u$inc

(data, value) Date

Adds value to data.

Parameters

Returns

Properties

default

Inherited from : lib/schematype.js:54

The default value of the field.

required

Inherited from : lib/schematype.js:66

Determines whether the field is required.

type

static