import InputDate from 'uc-input-field-date';
const elDisplay = get('#display');
const input = new InputDate({
title: 'date field',
onChange: val => {
console.log('new date', val);
}
}).appendTo(elDisplay);
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
if val
is undefined returns current value, otherwise sets the value. The value is an instance of the Date
class.
Sets the focus.
Removes focus.
Sets the state.
Shows the error with optional msg
.
Removes the input.
License MIT
© velocityzen