
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
A simple date calculator from my personal project Zhihu-Spider
Test Framework is ava
npm install
npm test
add the time(timestamp) function that returns full date
add the beforeCN and afterCN function that returns chinese format days
fix bug of monthEN() function
add the today function
const DateCalc = require('date-calc')
const d = new DateCalc()
d.today() // returns today date
fix the new Date() bug of Safari of macOS and iOS
now()The now() can receive a parameter like now(20161001)
const DateCalc = require('date-calc')
let d = new DateCalc();
console.log(d.now()) // returns now date
d.now('20161002') // changs DateCalc's inner data
console.log(d.now()) // returns 20161002
console.log(d.before()) // returns 20161001
console.log(d.after(10)) // returns 20161012
weekDay()The weekDay() returns an Object of weekdays info
const DateCalc = require('date-calc')
let d = new DateCalc('20161001');
d.weekDay() // returns { day: 6, en: 'Sat', cn: '六' }
const DateCalc = require('date-calc')
// or ES2015
// import DateCalc from 'date-calc'
let d = new DateCalc('20460818');
d.before();
d.after();
d.before(2);
d.after(2);
d.now();
d.month();
d.beforeMonth()
d.afterMonth()
new DateCalc() no parameters means todaynew DateCalc('20460818') reference dated.before() the day before reference date 20460817d.after() the day after reference date 20460819d.before(2) twos days before reference date 忽略初始天数 20460816d.after(2) twos days after reference date 20460820d.now() now date 20460818d.month() the month of reference date 204608d.beforeMonth() the month before reference date 204607d.afterMonth() the month after reference date 204609new DateCalc('20460118').monthEN() returns 'Jan'new DateCalc('20460218').monthEN() returns 'Feb'new DateCalc('20460318').monthEN() returns 'Mar'new DateCalc('20460418').monthEN() returns 'Apr'new DateCalc('20460518').monthEN() returns 'May'new DateCalc('20460618').monthEN() returns 'Jun'new DateCalc('20460718').monthEN() returns 'Jul'new DateCalc('20460818').monthEN() returns 'Aug'new DateCalc('20460918').monthEN() returns 'Sep'new DateCalc('20461018').monthEN() returns 'Oct'new DateCalc('20461118').monthEN() returns 'Nov'new DateCalc('20461218').monthEN() returns 'Dec'new DateCalc('20460118').CHN() returns '2046年01月18日'FAQs
a simple date calculator for javascript
We found that date-calc 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.