Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
calendarize
Advanced tools
A tiny (196B) utility to generate calendar views.
This function (optionally) accepts a date in exchange for a calendar view of that date's month.
Additionally, this module is delivered as:
dist/calendarize.mjs
dist/calendarize.js
dist/calendarize.min.js
$ npm install --save calendarize
via Date Instance
import calendarize from 'calendarize';
const date = new Date('2019-12-20');
const view = calendarize(date);
//=> [
//=> [ 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, 0, 0, 0, 0],
//=> ]
via Date String
import calendarize from 'calendarize';
const view = calendarize('Nov 01, 2019');
//=> [
//=> [ 0, 0, 0, 0, 0, 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],
//=> ]
Returns: Array<Week>
An Array of Week
Arrays is returned.
Each Week
is an Array of 7 numbers, each representing a numerical date.
Important: A zero (
0
) value represents a date that exists beyond the current month view.
Type: string
| number
| Date
Default: new Date()
– aka, today
The date you want to process.
Important: Your
string|number
value will be cast to aDate
object, which means Node.js may apply incorrect timezone!
MIT © Luke Edwards
FAQs
A tiny (202B) utility to generate calendar views
The npm package calendarize receives a total of 6,936 weekly downloads. As such, calendarize popularity was classified as popular.
We found that calendarize 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.