You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A date picker UI component built on component/calendar. Forked from component/datepicker.
How to use
This is a component component. You can easily plug it into your site or web app. Check the example of usage in test/index.html. To get things working, follow these easy steps (assuming you already have Node.js and npm installed):
npm install -g component
Clone this repository and navigate into the component folder
Run component install to fetch dependencies
Run component build
Now you can open test/index.html and if everything is fine you should be able to see the component in action
If your app already uses components, you can simply run component install redbadger/datepicker - this will fetch and install all dependencies into /components folder of your project.
Features
Takes and returns a value of type Date
Hide on click outside
Manual date change support
Keyboard interaction
Fully configurable date format with custom divider symbols
Example
varDatepicker=require('datepicker');varpicker=Datepicker(document.getElementById('date'),"DD/MM/YYYY")picker.value(newDate());picker.value()// => currently selected date as a Date instance
Custom date format
You can specify the format of the date you expect it to produce. Format is a string, which can be something like this:
"DD/MM/YYYY"
"YYYY-MM-DD"
"mm.dd.yy"
Order of month, day and year will be recognized by the component, divider symbol will also be honored. You can ask for 2 digit year or 4 with "YY" or "YYYY" respectably.
API
.value(value)
Get or set current value. value argument is optional.