Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Calendar UI component
JavaScript
Branch: master
Pull request Compare This branch is 10 commits ahead, 42 commits behind component:master.
Failed to load latest commit information.
lib improve return condition for invalidDate
test example
.gitignore add history.md
History.md Release 0.0.3
Makefile Initial commit
Readme.md Merge branch 'cf'
component.json Use colinf/range for reverse list of years
index.js Initial commit
package.json Release 0.0.3

Readme.md

Calendar

Calendar UI component designed for use as a date-picker, full-sized calendar or anything in-between.

javascript calendar component

Differences from component/calendar

This project is a fork from component/calendar and unless you need any of the differences listed below, it may be better to use component/calendar as a dependency in your project.

The current differences from component/calendar are as follows:

  • Supports reverse list of years i.e. where from > to in showYearSelect(from, to)
  • Constrains calendar to one of the years in from through to
  • Uses colinf/range rather than component/range

Installation

$ component install colinf/calendar

Example

var Calendar = require('calendar');
var cal = new Calendar;
cal.el.appendTo('body');

Events

  • view change (date, action) when the viewed month/year is changed without modification of the selected date. This can be done either by next/prev buttons or dropdown menu. The action will be "prev", "next", "month" or "year" depending on what action caused the view to change.
  • change (date) when the selected date is modified

API

new Calendar(date)

Initialize a new Calendar with the given date shown, defaulting to now.

Calendar#select(date)

Select the given date (Date object).

Calendar#show(date)

Show the given date. This does not select the given date, it simply ensures that it is visible in the current view.

Calendar#showMonthSelect()

Add month selection input.

Calendar#showYearSelect([from], [to])

Add year selection input, with optional range specified by from and to, which default to the current year -10 / +10.

Calendar#prev()

Show the previous view (month).

Calendar#next()

Show the next view (month).

Themes

Aurora:

License

MIT

Something went wrong with that request. Please try again.