Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ddday

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ddday

Provides a double-digit representation for the requested day of a month.

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ddday

Provides a double-digit representation for the requested day of a month.

Naming

As the naming reveals ddday stands for double-digit representation of a month's day. Of course, "two-digit" sounds better than "double-digit", but the latter makes the final abbreviation more funny :bowtie: .

Reason

Javascript's Date object returns by default the numerical representation of a month's day without providing any option to easily format it. As user, I would like to have a universal formatting among days of the month (i.e. I would like the 9th of a month to be displayed as "09" and not as "9", because there are cases where either it is not always easy to modify your data or you simply do not want to.

Install

npm install -g ddday

Use

// load the module
var ddday = require('ddday');

// example: 9th is represented with '9'. Convert it to '09'
ddday(new Date().getDate()) // returns '09', if current day is the 9th of the month

Test

To execute tests, first install the project dependencies:

$ npm install

Then, run the tests

$ npm test

Keywords

FAQs

Package last updated on 16 Dec 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc