
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
calendar-view-utils
Advanced tools
Utilities for building calendar views.
Date
objects, no library required.npm install calendar-view-utils --save
import { CalendarMonth } from 'calendar-view-utils';
const date = new Date(2021, 0, 1);
const view = new CalendarMonth(date);
console.log(view);
CalendarMonth
Create a CalendarMonth
for the target date
. A CalendarMonth
contains all the needed information
for building a standard month view.
new CalendarMonth(date);
Property | Description | Type |
---|---|---|
year | Year value | number |
month | Month value | number |
weeks | Collection of weeks with the month | CalendarWeek[] |
CalendarWeek
Create a CalendarWeek
for the target date
. A CalendarWeek
contains all the needed information
for building a standard week view.
new CalendarWeek(date);
Property | Description | Type |
---|---|---|
isoWeek | ISO week value | number |
days | Collection of days within the week | CalendarDay[] |
CalendarDay
Create a CalendarDay
for the target date
.
new CalendarDay(date);
Property | Description | Type |
---|---|---|
isoString | ISO string value (date) | string |
day | Day of month value | number |
month | Month value | number |
year | Year value | number |
isToday | Indicates if the day is today. | boolean |
isPast | Indicates if the day is before today | boolean |
isFuture | Indicates if the day is after today | boolean |
import { DayOfWeek } from 'calendar-view-utils';
const options = {
weekStartsOn: DayOfWeek.Monday,
};
const view = new CalendarWeek(date, options);
Property | Description | Type | Default |
---|---|---|---|
weekStartsOn | Which day the week starts on | DayOfWeek | Sunday |
import { DayOfWeek, getWeekDays } from 'calendar-view-utils';
const example1 = getWeekDays();
// => [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
const example2 = getWeekDays(DayOfWeek.Monday);
// => [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]
npm install
npm run build
FAQs
Utilities for generating calendar views.
The npm package calendar-view-utils receives a total of 6 weekly downloads. As such, calendar-view-utils popularity was classified as not popular.
We found that calendar-view-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.