JTSageDateBox A multi-mode date and time picker

Date and Time Limits

The reason many people choose to use DateBox over the other available options is that it includes a massive amount of data limiting controls. You are able to specify exactly what is valid data through the control - of course, you should still verify data on your end, but for the normal user, this will prevent them from submitting bad data through ignorance.

Data limiting works in a number of ways - there are options to disallow individual dates, individual days (such as weekends), recurring dates, or even limit to just a set of specifically good data. Similar options are available for time entry. Additionally options exist to jump to known good dates, and to highlight preferred dates or days as needed.

Precedence

Precedence is simple. A Date or Time is considered valid unless (in this order):

Caveats

All limit checks are run on every date and every time, if they are set. So, setting a date limit for a time mode will often produce unusual results.

Limit Options

The below list are all of the limiting options available in DateBox

Dates selected must be after today's real date, or, all dates prior to today's date are invalid.

This is based on the first open of the widget - should a page be opened very close to midnight, an off-by one error might appear.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Boolean
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

Dates selected must be before today's real date, or, all dates after to today's date are invalid.

This is based on the first open of the widget - should a page be opened very close to midnight, an off-by one error might appear.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Boolean
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

A list (array) of ISO-8601 (YYYY-MM-DD) dates that are to be considered invalid.

Processing order:

  • enableDates ( If used, the list is exclusive )
  • whiteDates ( Whitelisted dates will always pass )
  • All date limiters, in a pile-on fashion
Example
// Christmas and New Years, 2000/2001
["2001-01-01", "2000-12-31", "2000-12-25", "2000-12-24"]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

A list of recurring dates that are to be consided invalid.

Each date element is an array of the format

[<year>, <month>, <date>]
  • year : 4 digit year
  • month : 0 based month, (0 = January … 11= December )
  • date : date

Additionally, using "-1" as an element treats it as a wildcard, that is "every year/month/day"

Processing order:

  • enableDates ( If used, the list is exclusive )
  • whiteDates ( Whitelisted dates will always pass )
  • All date limiters, in a pile-on fashion
Example
// (Chrismas, Christmas Eve, New Years Eve, and New Years Day, Every Year)
[ [-1,0,1], [-1,11,31], [-1,11,25], [-1,11,24] ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

A list of periodic dates to blacklist.

Takes an array of the format

[<start date>, <period>]
  • date : ISO-8601 start date
  • period : integer, i.e 7 (weekly), 14 (bi-monthly)
Example
// (Every other wednesday)
[ "2019-09-11", 14 ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

A list (array) of days of the week that are to be considered invalid. Zero based ( 0 = Sunday … 6 = Saturday )

Processing order:

  • enableDates ( If used, the list is exclusive )
  • whiteDates ( Whitelisted dates will always pass )
  • All date limiters, in a pile-on fashion
Example
// Weekends
[ 0, 6 ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

List of 2-element arrays to show in a special pick list. Used with calShowDateList.

The inner array structure is:

[ISO-Date, Description]
Example
[ ["1980-04-25", "JT's Date of Birth"], ["1809-02-12", "Lincoln's Birthday"] ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

Array of ISO-8601 (YYYY-MM-DD) dates that are exclusively valid and all others should be disabled. If this is in use, no other date checks are performed.

Processing order:

  • enableDates ( If used, the list is exclusive )
  • whiteDates ( Whitelisted dates will always pass )
  • All date limiters, in a pile-on fashion
Example
// Christmas, Christmas Eve, and New Years Eve of 2000 exclusively
[ "2000-12-31", "2000-12-25", "2000-12-24" ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, timebox, datetimeflipbox, flipbox, timeflipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

An alternate list of dates to highlight with theme.cal_DateHighAlt

Example

```js // December 2000 Holiday Seson ["2001-01-01", "2000-12-31", "2000-12-25", "2000-12-24"]

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

An list of dates to highlight with theme.cal_DateHigh

Example

```js // December 2000 Holiday Seson ["2001-01-01", "2000-12-31", "2000-12-25", "2000-12-24"]

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

A list of recurring dates to highlight with theme.cal_DateHighRec

Each date element is an array of the format

[<year>, <month>, <date>]
  • year : 4 digit year
  • month : 0 based month, (0 = January … 11= December )
  • date : date

Additionally, using "-1" as an element treats it as a wildcard, that is "every year/month/day"

Example
// (Chrismas, Christmas Eve, New Years Eve, and New Years Day, Every Year)
[ [-1,0,1], [-1,11,31], [-1,11,25], [-1,11,24] ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

A list of periodic dates to highlight with theme.cal_DateHighRec

Takes an array of the format

[<start date>, <period>]
  • date : ISO-8601 start date
  • period : integer, i.e 7 (weekly), 14 (bi-monthly)
Example
// (Every other wednesday)
[ "2019-09-11", 14 ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

A list (array) of days of the week that are to be highlighted with theme.cal_DayHigh.

Zero based ( 0 = Sunday … 6 = Saturday )

Example
// Weekends
[ 0, 6 ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): calbox
Operation mode(s) this option applies to

ISO string minimum date (YYYY-MM-DD) (Inclusive!)

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: String
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

ISO string maximum date (YYYY-MM-DD) (Inclusive!)

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: String
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

Only accept dates that are today - # of days in the future (min).

Both options will accept negative numbers:

minDays = 10
maxDays = -5

This would allow only days that are 5 to 10 days in the past to be choosen.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

Only accept dates that are today + # of days in the future (max)

Both options will accept negative numbers:

minDays = 10
maxDays = -5

This would allow only days that are 5 to 10 days in the past to be choosen.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

Do not allow durations less (min) or greater (max) than this to be selected.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): durationbox, durationflipbox
Operation mode(s) this option applies to

Do not allow durations less (min) or greater (max) than this to be selected.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): durationbox, durationflipbox
Operation mode(s) this option applies to

Allow only hours before (min) or after (max) this to be selected.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): timebox, datetimeflipbox, timeflipbox, datetimeflipbox
Operation mode(s) this option applies to

Allow only hours before (min) or after (max) this to be selected.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): timebox, datetimeflipbox, timeflipbox, datetimeflipbox
Operation mode(s) this option applies to

Allow only times before (min) or after (max) this to be selected. Format is 24hr clock - i.e. 18:31

Note: this limits date selection to TODAY (datetime modes).

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: String
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): timebox, datetimeflipbox, timeflipbox, datetimeflipbox
Operation mode(s) this option applies to

Allow only times before (min) or after (max) this to be selected. Format is 24hr clock - i.e. 18:31

Note: this limits date selection to TODAY (datetime modes).

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: String
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): timebox, datetimeflipbox, timeflipbox, datetimeflipbox
Operation mode(s) this option applies to

Do not allow years before (min) or after (max) this one to be selected.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

Do not allow years before (min) or after (max) this one to be selected.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Integer
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

Allows those dates that are not the true value of the client's today (new Date(); at widget open) to be selected.

Note: if used with time only modes, this will break them.

Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Boolean
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

List of 2-element arrays to show in a special pick list. Used with slideShowDateList.

The inner array structure is:

[ISO-Date, Description]
Example
[ ["1980-04-25", "JT's Date of Birth"], ["1809-02-12", "Lincoln's Birthday"] ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): slidebox
Operation mode(s) this option applies to

Array of valid hours to choose (24hr based)

Example
// Standard working hours
[ 9, 10, 11, 12, 13, 14, 15, 16, 17 ]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, timebox, datetimeflipbox, flipbox, timeflipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

A list (array) of ISO-8601 (YYYY-MM-DD) dates that are to be considered valid always.

Processing order:

  • enableDates ( If used, the list is exclusive )
  • whiteDates ( Whitelisted dates will always pass )
  • All date limiters, in a pile-on fashion
Example
// Christmas and New Years, 2000/2001
["2001-01-01", "2000-12-31", "2000-12-25", "2000-12-24"]
Default: false
The default value of the option. Many options use "false" to disable them.
Data Type Expected: Array
The datatype the option is expecting
Option is Dynamic: yes
The option can be toggled or reset after the control has loaded
Valid Mode(s): datebox, datetimebox, flipbox, datetimeflipbox, slidebox, calbox
Operation mode(s) this option applies to

JTSage DateBox Documentation v.5.3.3