Unchained UI
Input Date Field UI Component
Usage
; const elDisplay = ; const input = title: 'date field' { console; };
This component follows Unchained UI guidelines.
Constructor options:
- el – HTLMElement, parse all the information from the DOM element
- title — string, title of the input
- value — integer, timestamp in milliseconds or string, representing a date in a format recognized by the
Date.parse()
method - locale — a locale object. Defined as in uc-calendar
- debounce – number, default 500ms. Debounce onChange calls
- onChange — function, callback will be called when value is changed
Methods
value([val])
if val
is undefined returns current value, otherwise sets the value. The value is an instance of the Date
class.
focus()
Sets the focus.
blur()
Removes focus.
active(state)
Sets the state.
error([msg])
Shows the error with optional msg
.
remove()
Removes the input.
License MIT
© velocityzen