date-template
Advanced tools
Comparing version 2.0.7 to 2.0.8
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6627
156