![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
dates-in-js
Advanced tools
The dates-in-js npm package is a custom date library designed to simplify date and time operations in JavaScript. It provides an intuitive way to work with dates, offering a set of methods for retrieving various date components, formatting dates, and calc
Readme
The dates-in-js npm package is a custom date library designed to simplify date and time operations in JavaScript. It provides an intuitive way to work with dates, offering a set of methods for retrieving various date components, formatting dates, and calculating relative time differences from the current date.
To start using dates-in-js in your JavaScript projects, you can install it via npm:
npm install dates-in-js
Once you have installed dates-in-js, you can import the desired functions into your JavaScript code:
const dateJS = require('dates-in-js');
dates-in-js offers a wide range of features that empower you to work with dates more effectively:
const D = require('betterdate');
// Creating a datejs instance
const currentDate = new D();
// Accessing date components
console.log(currentDate.year); // 2023
console.log(currentDate.yr); // 6
console.log(currentDate.month); // September
console.log(currentDate.mon); // Sep
console.log(currentDate.day); // Wednesday
console.log(currentDate.dy); // Wed
console.log(currentDate.date); // 6
console.log(currentDate.hours); // 11
console.log(currentDate.mins); // 13
console.log(currentDate.secs); // 45
// Formatting dates
console.log(currentDate.format('Y-M-D h:I:S')); // 2023-September-06 11:13:45
console.log(currentDate.format('y/m/D')); // 23/sep/06
// Calculating relative time differences
const futureDate = new D(2024, 9, 6);
console.log(futureDate.when()); // 1 year from now
const pastDate = new D(2023, 3, 6);
console.log(pastDate.when()); // 6 months ago
I welcome contributions from the community to improve and expand the functionality of dates-in-js. If you have any suggestions, bug reports, or feature requests, please don't hesitate to open an issue or submit a pull request on the GitHub repository.
FAQs
[![npm version](https://img.shields.io/npm/v/.svg)](https://www.npmjs.com/package/dates-in-js)
The npm package dates-in-js receives a total of 1 weekly downloads. As such, dates-in-js popularity was classified as not popular.
We found that dates-in-js demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.