Skip to content
Calendar UI component
JavaScript
Pull request Compare This branch is 10 commits ahead of markreg:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
examples
lib
.gitignore
History.md
README.md
index.js
package.json

README.md

Calendar

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

javascript calendar component

Ported from component/calendar to a proper npm module

Installation

$ npm i raynos-calendar

Example

var Calendar = require('raynos-calendar')
var cal = new Calendar
cal.el // =>

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#value()

Returns the current date value in the calendar

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.