Skip to main content
Home

Built and signed on GitHub Actions

Works with
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score76%
Downloads3/wk
Published2 weeks ago (0.1.2)

A no-dependency utility to generate a month calendar including leading and trailing days.

calendarGrid

A no-dependency utility to generate a month calendar including leading and trailing days.

Install

  • JSR via NPM npx jsr add @jgusta/calendar-grid @jgusta/calendar-grid

  • JSR via Deno import { monthGrid } from "jsr:@jgusta/calendar-grid";

Usage

import { monthGrid, MONTHS, getWeekdays } from 'calendar-grid'

const month = 1 // February (1-based)
const year = 2025

const cells = monthGrid({ month, year, mondayFirst: true })
console.log(MONTHS[month]) // "February"
console.log(getWeekdays(true)) // Monday-first order

API

  • monthGrid(month: number, year: number): CalendarCell[]
  • monthGrid({ month: number; year: number; mondayFirst?: boolean }): CalendarCell[]
  • MONTHS: readonly string[]
  • getWeekdays(mondayFirst?: boolean): DayType[]
  • Types: CalendarCell, DayType, MonthPosition
Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@jgusta/calendar-grid

Import symbol

import * as calendar_grid from "@jgusta/calendar-grid";
or

Import directly with a jsr specifier

import * as calendar_grid from "jsr:@jgusta/calendar-grid";

Add Package

pnpm i jsr:@jgusta/calendar-grid
or (using pnpm 10.8 or older)
pnpm dlx jsr add @jgusta/calendar-grid

Import symbol

import * as calendar_grid from "@jgusta/calendar-grid";

Add Package

yarn add jsr:@jgusta/calendar-grid
or (using Yarn 4.8 or older)
yarn dlx jsr add @jgusta/calendar-grid

Import symbol

import * as calendar_grid from "@jgusta/calendar-grid";

Add Package

vlt install jsr:@jgusta/calendar-grid

Import symbol

import * as calendar_grid from "@jgusta/calendar-grid";

Add Package

npx jsr add @jgusta/calendar-grid

Import symbol

import * as calendar_grid from "@jgusta/calendar-grid";

Add Package

bunx jsr add @jgusta/calendar-grid

Import symbol

import * as calendar_grid from "@jgusta/calendar-grid";