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

date-template

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-template - npm Package Compare versions

Comparing version 2.0.7 to 2.0.8

2

package.json
{
"name": "date-template",
"version": "2.0.7",
"version": "2.0.8",
"description": "Easy function for returning date by template.",

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

@@ -102,10 +102,18 @@ # date-template

var middlewareAmPm = (date) => {
date.h.value = date.h.value % 12
? date.h.value - 12 + 'pm'
: date.h.value + 'am'
date.ampm = {
key: /%am:pm/g,
value: date.h.value / 12 > 1
? 'pm'
: 'am'
}
date.h.value = date.h.value / 12 > 1
? date.h.value - 12
: date.h.value
return date
}
dateTemplate('%h', false, middlewareAmPm)
// 8pm
dateTemplate('%h:%0m %am:pm', false, middlewareAmPm)
// 8:09 pm
```

@@ -112,0 +120,0 @@

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