New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

format-date

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-date - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

14

index.js

@@ -9,3 +9,3 @@ var format = require("format-text");

function formatDate (template, date) {
if (!date) return template;
if (!date) date = new Date;

@@ -20,4 +20,14 @@ return format(template, {

'day-name': days[date.getDay()],
'month-name': months[date.getMonth()]
'month-name': months[date.getMonth()],
// utc
'utc-day': leftpad(date.getUTCDate(), 2, '0'),
'utc-month': leftpad(date.getUTCMonth() + 1, 2, '0'),
'utc-year': date.getUTCFullYear(),
'utc-hours': leftpad(date.getUTCHours(), 2, '0'),
'utc-minutes': leftpad(date.getUTCMinutes(), 2, '0'),
'utc-seconds': leftpad(date.getUTCSeconds(), 2, '0'),
'utc-day-name': days[date.getUTCDay()],
'utc-month-name': months[date.getUTCMonth()]
});
}

2

package.json
{
"name": "format-date",
"version": "0.0.0",
"version": "0.0.1",
"description": "Takes a string and a date object, returns what you expect",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -16,3 +16,3 @@ ## format-date

formatDate('{month-name} {year}')
formatDate('{month-name} {year}', new Date)
// => January 2014

@@ -29,3 +29,2 @@ ```

```js
* day

@@ -39,2 +38,1 @@ * day-name

* seconds
```
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