New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

calendr

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calendr

Calendar grid generator

  • 0.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Calendr.js

Build Status Code Climate David DM

Weeks array grid for calendar month

Installation

npm install calendr

Example

var Calendr = require('calendr');

var april = new Date(2014, 3); // month is 0 indexed
var aprilcal = new Calendr(april);

aprilcal.grid

Returns:

[
  [30,  31,  1,   2,   3,   4,   5],
  [6,   7,   8,   9,   10,  11,  12],
  [13,  14,  15,  16,  17,  18,  19],
  [20,  21,  22,  23,  24,  25,  26],
  [27,  28,  29,  30,  1,   2,   3]
]

When dayObjects is true each day item is returned as a Day object instead of a Number.

var april = new Date(2014, 3);
var aprilcal = new Calendr(april);
aprilcal.dayObjects = true;

or

var aprilcal = new Calendr(april, {dayObjects: true});

Day objects include these methods:

day.date()       // the date eg. 12
day.month()      // the month eg. 2 (this is 1 index)
day.year()       // the full year eg. 2014
day.isToday()    // returns Boolean based on whether this `Day` is today
day.name()       // the name of the day of the week, eg. Monday, Tuesday, etc...
day.monthName()  // the name of the day of the month, eg. January, February, etc...

day.moment       // returns the day's date as a Moment.js object

License

MIT

Keywords

FAQs

Package last updated on 15 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc