Methods
(static) getReprPattern() → {string}
Gets the pattern for the date representation.
Returns:
A pattern
- Type
- string
Example
config.getReprPattern(); // returns 'DD/MM/YYYY'
- - -
(static) getYearRange() → {Array.<Object>}
Gets the range of valid years.
Returns:
An array with starting and ending dates
- Type
- Array.<Object>
Example
config.getYearRange(); // returns [ 1900, 2099 ]
- - -
(static) setReprPattern(pattern) → {boolean}
Sets the pattern for the date representation (by default DD/MM/YYYY).
Parameters:
Name | Type | Description |
---|---|---|
pattern |
string | A pattern consisted of separators and series of letters 'D', 'M', 'Y' (or 'd', 'm', 'y') expressing day, month, year. Using capitals the width of the date remains fixed (ex. DD/MM/YYYY for 01/01/2021) but using small letters becomes flexible (ex. dd/mm/yyyy for 1/1/2021). |
Returns:
True on success or false on invalid param
- Type
- boolean
Example
config.setReprPattern( 'DD-MM-YY' ); // returns true
config.setReprPattern( 0 ); // returns false
- - -
(static) setYearRange(from, till) → {boolean}
Sets the range of valid years (by default from 1900 to 2099).
Parameters:
Name | Type | Description |
---|---|---|
from |
number | The starting year |
till |
number | The ending year |
Returns:
True on success or false on invalid params
- Type
- boolean
Example
config.setYearRange( 1850, 2149 ); // returns true
config.setYearRange( '1850-2149' ); // returns false
- - -