UIDatePicker

Create a simple input with date-picker functionality.

Properties

Name

Type

Default

Description

placeholder

string

Required - The text of the placeholder if no date is selected

value

string

Required - The date to present in the input, should be in YYYY-MM-DD format (2019-11-01), if empty string, value will be set to "today"

disabled

boolean

false

Set to true to disable input

keepPlaceholderInValue

boolean

false

onChange

function

Callback for when the input is changed, callback will be called with one argument, the new value in YYYY-MM-DD format

Example

import {UIDatePicker} from 'writer'

render($$) {
    return $$('div').append(
        $$(UIDatePicker, {
            value: '2019-11-01',
            onChange: (newValue) => {
                this.extendState({ inputDateValue: newValue })
            },
        }).ref('myInputDateValue')
    )
}

Last updated