US date input component for virtual-dom
$ npm install --save us-date-input
var DateInput = require('us-date-input')
var dateInput = DateInput()
function render (state) {
var vtree = DateInput.render(state)
//=> use virtual-dom to patch vtree into real DOM
}
dateInput(render)
Create a new date input observable.
Type: object
The initial state of the input.
Type: string
The date in US format (MM/DD/YYYY). You can also set this to a Date
object or an ISO date string. User inputs are parsed in US format and saved as strings.
Validate the date input state.
Get a true Date
object or null
if the state is invalid.
Render an date state to a vtree object. options
will be merged with the defaults and passed to virtual-hyperscript.
MIT © Ben Drucker