npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sl-code-lords/calendar

v1.0.0

Published

generate a calendar for a specific year using JavaScript

Downloads

14

Readme

Status GitHub Issues GitHub Pull Requests License


📝 Table of Contents

🧐 About

generate a calendar for a specific year using JavaScript

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes

Installing

yarn add @sl-code-lords/calendar

or

npm i @sl-code-lords/calendar

🎈 Usage

const Calendar = require('@sl-code-lords/calendar')
const calendar = new Calendar(2023)

get Month

var dec = calendar.month(12)

console.log(dec)
Month {
  name: 'December',
  year: 2023,
  moon: {
    '1': { name: 'waning-gibbous-moon', power: 5.3094445575807185 },
    '2': { name: 'last-quarter-moon', power: 5.580350099515272 },
    '3': { name: 'last-quarter-moon', power: 5.851255641451644 },
    '4': { name: 'last-quarter-moon', power: 6.122161183386197 },
    '5': { name: 'last-quarter-moon', power: 6.393066725322569 },
    '6': { name: 'waning-crescent-moon', power: 6.663972267258941 },
    '7': { name: 'waning-crescent-moon', power: 6.934877809193495 },
    '8': { name: 'waning-crescent-moon', power: 7.205783351129867 },
    '9': { name: 'waning-crescent-moon', power: 7.476688893066239 },
    '10': { name: 'new-moon', power: 7.747594435000792 },
    '11': { name: 'new-moon', power: 0.01849997693716432 },
    '12': { name: 'new-moon', power: 0.2894055188717175 },
    '13': { name: 'waxing-crescent-moon', power: 0.5603110608080897 },
    '14': { name: 'waxing-crescent-moon', power: 0.8312166027444619 },
    '15': { name: 'waxing-crescent-moon', power: 1.102122144679015 },
    '16': { name: 'waxing-crescent-moon', power: 1.3730276866153872 },
    '17': { name: 'quarter-moon', power: 1.6439332285499404 },
    '18': { name: 'quarter-moon', power: 1.9148387704863126 },
    '19': { name: 'quarter-moon', power: 2.1857443124226847 },
    '20': { name: 'quarter-moon', power: 2.456649854357238 },
    '21': { name: 'waxing-gibbous-moon', power: 2.72755539629361 },
    '22': { name: 'waxing-gibbous-moon', power: 2.9984609382299823 },
    '23': { name: 'waxing-gibbous-moon', power: 3.2693664801645355 },
    '24': { name: 'full-moon', power: 3.5402720221009076 },
    '25': { name: 'full-moon', power: 3.811177564035461 },
    '26': { name: 'full-moon', power: 4.082083105971833 },
    '27': { name: 'full-moon', power: 4.352988647908205 },
    '28': { name: 'waning-gibbous-moon', power: 4.623894189842758 },
    '29': { name: 'waning-gibbous-moon', power: 4.8947997317791305 },
    '30': { name: 'waning-gibbous-moon', power: 5.165705273713684 },
    '31': { name: 'waning-gibbous-moon', power: 5.436610815650056 }
  },
  object: {
    Sunday: [ ' *', '03', '10', '17', '24', '31' ],
    Monday: [ ' *', '04', '11', '18', '25', ' *' ],
    Tuesday: [ ' *', '05', '12', '19', '26', ' *' ],
    Wednesday: [ ' *', '06', '13', '20', '27', ' *' ],
    Thursday: [ ' *', '07', '14', '21', '28', ' *' ],
    Friday: [ '01', '08', '15', '22', '29', ' *' ],
    Saturday: [ '02', '09', '16', '23', '30', ' *' ]
  },
  string: 'Su Mo Tu We Th Fr Sa\n' +
    ' *  *  *  *  * 01 02\n' +
    '03 04 05 06 07 08 09\n' +
    '10 11 12 13 14 15 16\n' +
    '17 18 19 20 21 22 23\n' +
    '24 25 26 27 28 29 30\n' +
    '31  *  *  *  *  *  *',
  array: [
    [
      'Su', 'Mo',
      'Tu', 'We',
      'Th', 'Fr',
      'Sa'
    ],
    [
      ' *', ' *',
      ' *', ' *',
      ' *', '01',
      '02'
    [
      '03', '04',
      '05', '06',
      '07', '08',
      '09'
    ],
    [
      '10', '11',
      '12', '13',
      '14', '15',
      '16'
    ],
    [
      '17', '18',
      '19', '20',
      '21', '22',
      '23'
    ],
    [
      '24', '25',
      '26', '27',
      '28', '29',
      '30'
    ],
    [
      '31', ' *',
      ' *', ' *',
      ' *', ' *',
      ' *'
    ]
  ],
  dayNames: [
    'Sunday',
    'Monday',
    'Tuesday',
    'Wednesday',
    'Thursday',
    'Friday',
    'Saturday'
  ]
}

Full calendar

var year = calendar.get_year()

string

console.log(year.calendar)
2023 Calendar

January
Su Mo Tu We Th Fr Sa
01 02 03 04 05 06 07
08 09 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31  *  *  *  *

February
Su Mo Tu We Th Fr Sa
 *  *  * 01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28  *  *  *  *

March
Su Mo Tu We Th Fr Sa
 *  *  * 01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  *

April
Su Mo Tu We Th Fr Sa
 *  *  *  *  *  * 01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30  *  *  *  *  *  *

May
Su Mo Tu We Th Fr Sa
 * 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31  *  *  *

June
Su Mo Tu We Th Fr Sa
 *  *  *  * 01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  *

July
Su Mo Tu We Th Fr Sa
 *  *  *  *  *  * 01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31  *  *  *  *  *

August
Su Mo Tu We Th Fr Sa
 *  * 01 02 03 04 05
06 07 08 09 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31  *  *

September
Su Mo Tu We Th Fr Sa
 *  *  *  *  * 01 02
03 04 05 06 07 08 09
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

October
Su Mo Tu We Th Fr Sa
01 02 03 04 05 06 07
08 09 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31  *  *  *  *

November
Su Mo Tu We Th Fr Sa
 *  *  * 01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30  *  *

December
Su Mo Tu We Th Fr Sa
 *  *  *  *  * 01 02
03 04 05 06 07 08 09
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31  *  *  *  *  *  *

object

console.log(year.year)
{
  January: {
    name: 'January',
    year: 2023,
    moon: {
      '1': [Object],
      '2': [Object],
      '3': [Object],
      '4': [Object],
      '5': [Object],
      '6': [Object],
      '7': [Object],
      '8': [Object],
      '9': [Object],
      '10': [Object],
      ... 21 more items
    },
    object: {
      Sunday: [Array],
      Monday: [Array],
      Tuesday: [Array],
      Wednesday: [Array],
      Thursday: [Array],
      Friday: [Array],
      Saturday: [Array]
    },
    string: 'Su Mo Tu We Th Fr Sa\n' +
      '01 02 03 04 05 06 07\n' +
      '08 09 10 11 12 13 14\n' +
      '15 16 17 18 19 20 21\n' +
      '22 23 24 25 26 27 28\n' +
      '29 30 31  *  *  *  *',
    array: [ [Array], [Array], [Array], [Array], [Array], [Array] ],
    dayNames: [
      'Sunday',
      'Monday',
      'Tuesday',
      'Wednesday',
      'Thursday',
      'Friday',
      'Saturday'
    ]
  },
  February: {
    name: 'February',
    year: 2023,
    moon: {
      '1': [Object],
      '2': [Object],
      '3': [Object],
      '4': [Object],
      '5': [Object],
      '6': [Object],
      '7': [Object],
      '8': [Object],
      '9': [Object],
      '10': [Object],
      ... 18 more items
    },
    object: {
      Sunday: [Array],
      Monday: [Array],
      Tuesday: [Array],
      Wednesday: [Array],
      Thursday: [Array],
      Friday: [Array],
      Saturday: [Array]
    },
    string: 'Su Mo Tu We Th Fr Sa\n' +
      ' *  *  * 01 02 03 04\n' +
      '05 06 07 08 09 10 11\n' +
      '12 13 14 15 16 17 18\n' +
      '19 20 21 22 23 24 25\n' +
      '26 27 28  *  *  *  *',
    array: [ [Array], [Array], [Array], [Array], [Array], [Array] ],
    dayNames: [
      'Sunday',
      'Monday',
      'Tuesday',
      'Wednesday',
      'Thursday',
      'Friday',
      'Saturday'
    ]
  },
  March: {
    name: 'March',
    year: 2023,
    moon: {
      '1': [Object],
      '2': [Object],
      '3': [Object],
      '4': [Object],
      '5': [Object],
      '6': [Object],
      '7': [Object],
      '8': [Object],
      '9': [Object],
      '10': [Object],
      ... 21 more items
    },
    object: {
      Sunday: [Array],
      Monday: [Array],
      Tuesday: [Array],
      Wednesday: [Array],
      Thursday: [Array],
      Friday: [Array],
      Saturday: [Array]
    },
    string: 'Su Mo Tu We Th Fr Sa\n' +
      ' *  *  * 01 02 03 04\n' +
      '05 06 07 08 09 10 11\n' +
      '12 13 14 15 16 17 18\n' +
      '19 20 21 22 23 24 25\n' +
      '26 27 28 29 30 31  *',
    array: [ [Array], [Array], [Array], [Array], [Array], [Array] ],
    dayNames: [
      'Sunday',
      'Monday',
      'Tuesday',
      'Wednesday',
      'Thursday',
      'Friday',
      'Saturday'
    ]
  },
  ... 9 more items
}

✍️ Authors

See also the list of contributors who participated in this project.