node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

deku-datepicker

deku-datepicker Build Status

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