1.0.0 • Published 8 years ago

@circunspecter/calendar v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Calendar

A calendar building helper. Documentation and example

Installation

Browser

<script src="/path/to/calendar.min.js"></script>

unpkg CDN:

//unpkg.com/@circunspecter/calendar@latest/dist/calendar.min.js

npm

npm install @circunspecter/calendar

Usage

let calendar = new Calendar();

Some frequent calls:

// Month name
`${calendar.month.getName()} ${calendar.month.getYear()}`

// Previous month
calendar.month.getSibling(-1)

// Next month
calendar.month.getSibling(1).getName()

// Month total days
calendar.month.getLength()

// Loop through month days
calendar.month.getDays().forEach((day) => {
  `Day number: ${day.getNumber()}`
});

// Loop through week days
calendar.week.getDays().forEach((day) => {
  `Day name: ${day}`
});

// Short week day names
calendar.week.getDays('short')

Go to the project page to see the documentation and a working example.