Members
# constant currentDate
Store current date - contains day, month and year attributes
# constant currentTime
Store current time - contains hour and minute attributes
# constant getLimitYear
provides the start and end years of the select
# constant months
Provide month informations. Contains name (month names array) and getLength (function) attributes
Methods
# deleteSelectedDay()
iterates over elements with class selected-day and removes it
# getCalendarOption(item, baseId) → {object}
Provides span option for CalendarBox list
Parameters:
Name | Type | Description |
---|---|---|
item |
object
|
|
baseId |
string
|
date picker input id |
span html element
object
# getErrors(inputId)
Retrieves, in validation object, errors corresponding to id passed in parameter and adds them to error state
Parameters:
Name | Type | Description |
---|---|---|
inputId |
string
|
input id |
- See:
-
- errorAction.add
- validation
# getIsDefaultObject(isDate, isDateTime, isPeriod, isTime) → {object}
Provides object to define "is" attribute
Parameters:
Name | Type | Description |
---|---|---|
isDate |
boolean
|
|
isDateTime |
boolean
|
|
isPeriod |
boolean
|
|
isTime |
boolean
|
object
# getNumberDay(currentDay, monthLength, startDay) → {number}
Checks that the current day, passed as a parameter, is included in the number of days of the month. Otherwise fix it
Parameters:
Name | Type | Description |
---|---|---|
currentDay |
number
|
|
monthLength |
number
|
|
startDay |
number
|
dayNumber
number
# getSelectItemId(name) → {string}
Provide the id of the html select tag
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
string
# getSpan(textContent, id, isSelected, spanOnClickFunction) → {object}
Provides span option for Calendar Select list
Parameters:
Name | Type | Default | Description |
---|---|---|---|
textContent |
string
|
number
|
||
id |
string
|
||
isSelected |
boolean
|
false | |
spanOnClickFunction |
function
|
false |
span html element
object
# getSpanValue(value, maxValue, minValue) → {number}
Corrects the value passed in parameter if it does not respect the minimum and maximum values
Parameters:
Name | Type | Description |
---|---|---|
value |
number
|
|
maxValue |
number
|
|
minValue |
number
|
number
# moveDateSelectList(moreOrLess, id, list, maxValue, minValue)
Scrolls through list values - onClick
Parameters:
Name | Type | Default | Description |
---|---|---|---|
moreOrLess |
string
|
if receive "more" increment the value of the list else do a decrement |
|
id |
string
|
||
list |
array
|
||
maxValue |
number
|
||
minValue |
number
|
0 |
# onWheelFunction(e, id, list, maxValue, minValue)
Scrolls through list values - onWheel
Parameters:
Name | Type | Default | Description |
---|---|---|---|
e |
object
|
event |
|
id |
string
|
||
list |
array
|
||
maxValue |
number
|
||
minValue |
number
|
0 |
# setInitialDateState(draft, id, type)
Parameters:
Name | Type | Description |
---|---|---|
draft |
object
|
|
id |
string
|
|
type |
string
|
accept date, datePeriod, dateTime, dateTimePeriod, time, timePeriod |
# updateDateSelectList(id, list, maxValue, minValue, startValue)
modify span value of CalendarSelect
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
|
list |
array
|
|
maxValue |
number
|
|
minValue |
number
|
|
startValue |
number
|
Type Definitions
object
# datePickerParams
Store necessary informations and functions to execute DatePicker component
Properties:
Name | Type | Description |
---|---|---|
id |
object
|
Store id |
is |
object
|
Store "is" object. Contains date, dateTime, period and time attributes. |
deadlines |
object
|
Store deadlines applied to the DatePicker component |
addId |
function
|
Add ids to "id" attribute |
eventFunction |
object
|
Stores functions to be executed when events are triggered |
format |
object
|
Store format of input and output values |
getTimeSelectId |
function
|
Provide time select id |
htmlClass |
object
|
Stores html class provided as a parameter of DatePicker component. Use to define className |
label |
object
|
Store input label provided as a parameter of DatePicker component. Use to define label text |
initComponentParams |
function
|
Initializes the attributes containing the component parameters |
initIdHtml |
function
|
Initializes the html ids necessary to component operations |
listen |
function
|
Execute the functions corresponding to the eventName parameter |
setEventFunction |
function
|
Check and store the event functions passed as a parameter of the DatePicker component |
setHtmlClass |
function
|
Check and store html class passed as a parameter of the DatePicker component |
setInputId |
function
|
Check and store the input id passed as a parameter of the DatePicker component |
setLabel |
function
|
Check and store the input label passed as a parameter of the DatePicker component |
Examples
`datePickerParams.is = { date: true, dateTime: false, period: true, time: false }`
`datePickerParams.deadlines = { max: 2022-02-24, min: 2022-01-01 }`
object
# style
Provides the color, the background-color and the calendar icons corresponding to the theme
Properties:
Name | Type | Description |
---|---|---|
adviceColor |
function
|
Provides advice message font color |
backgroundColor |
function
|
Provides background color |
color |
function
|
Provides font color |
colors |
object
|
Store advice, dark, error, light and defaults fonts colors |
errorColor |
function
|
Provides error message font color |
icons |
object
|
Store icons |
page |
object
|
Store page font and background colors |
setColors |
function
|
Set font colors : dark and light theme, advice and error message |
object
# validation
Provides input and parameter check methods
Properties:
Name | Type | Description |
---|---|---|
error |
array
|
Stores errors in array |
addError |
function
|
Add an error object to error attribute |
allowedLength |
object
|
Provides allowed lengths. Contains dateInput, id, label attributes. These attributes contain an object having the min and max attributes. |
allowedType |
object
|
Provides allowed type (return of typeof). Contains eventFuntion attribute |
checkColor |
function
|
Checks that the color passed in parameter corresponds to the accepted format |
checkFormat |
function
|
Checks that the requested format matches the accepted format |
checkId |
function
|
Checks that id passed in parameter corresponds to the accepted format |
checkInputValue |
function
|
Checks that input value passed in parameter corresponds to the accepted format |
checkLabel |
function
|
Checks that label passed in parameter corresponds to the accepted format |
checkLimits |
function
|
Checks that deadlines passed in parameter corresponds to the accepted format |
checkString |
function
|
Checks length and format of string parameter |
checkType |
function
|
Checks if type is allowed |
clearError |
function
|
clear error attribute and error message displayed |
formats |
object
|
Provides format control functions and information |
regExpTest |
function
|
Apply RegExp test function |