deku-datepicker
v0.9.0
Published
Datepicker for deku
Downloads
15
Readme
deku-datepicker ![Build Status](https://travis-ci.org/ulrikaugustsson/deku-datepicker.svg?branch=master)
Datepicker for deku
Install
$ npm install --save deku-datepicker
Usage
import element from 'virtual-element';
import {render, tree} from 'deku';
import createPicker from 'deku-datepicker';
const DatePicker = createPicker();
function logDate(date) {
console.log(date);
}
const app = tree(
<DatePicker
chooseText="Välj datum"
callback={logDate} />
);
render(app, document.querySelector('main'));
API
const DatePicker = createDatePicker([opts]);
/*
opts {
yearPicker: <YearPicker />,
monthPicker: <MonthPicker />,
day: <Day />,
dayPicker: <DayPicker />,
chooseDayButton: <ChooseDayButton />
};
*/
<DatePicker
callback={logDate}
[chooseText="Välj datum" initialDate={new Date()}]/>
Check source for examples.
License
MIT © Ulrik Augustsson