0.0.2 ā€¢ Published 6 months ago

json-days v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

šŸ—“ļø json-days

A JSON data model for getting list of days in a specified year, quarter or month

Installation

npm install json-days

Usage

import { getDaysByYear, getDaysByMonth, getDaysByQuarter } from "json-days";

// getDaysByYear(year)
getDaysByYear(2023);

// getDaysByMonth(year, month_index)
getDaysByMonth(2023, 0); // returns data for the month of january 2023

// getDaysByQuarter(year, 1)
getDaysByQuarter(2023, 2); // retursn data for the 2nd quarter of 2023

Object structure

{
  year: 2023,
  result: [
    {
        id: "day1700694000000",
        date: "2023-11-22T23:00:00.000Z",
        month_index: 10,
        year: 2023,
        day: 23,
        is_weekend: false
      },
      ...
  ]
}

šŸŽ‰šŸŽ‰šŸŽ‰

0.0.2

6 months ago

0.0.1

6 months ago