Simple JavaScript calendar library.
npm install node-calendar-js``sh`
$ npm i node-calendar-js
`js
const { Calendar } = require("node-calendar-js");
const calendar = new Calendar({
year: 2021,
month: 0
});
console.log(calendar.create());
`
`js
import Calendar from "https://deno.land/x/calendar/mod.ts";
const calendar = new Calendar({
year: 2021,
month: 0
});
console.log(calendar.create());
`
`js
const calendar = new Calendar({
year: 2021,
month: 0
});
console.log(calendar.toHTML());
`
html
January 2021 Sunday Monday Tuesday Wednesday Thursday Friday Saturday 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 31
`Preview
January 2021 Sunday Monday Tuesday Wednesday Thursday Friday Saturday 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 31
String
`js
const calendar = new Calendar({
year: 2021,
month: 0
});console.log(calendar.toString());
`$3
`xl
╔═════════╤══════╗
║ January │ 2021 ║
╚═════════╧══════╝
┌────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────┐
│ Sunday │ Monday │ Tuesday │ Wednesday │ Thursday │ Friday │ Saturday │
├────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────┤
│ │ │ │ │ │ 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 │
├────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────┤
│ 31 │ │ │ │ │ │ │
└────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────┘
``