Comparing version 1.2.0 to 1.3.0
{ | ||
"extends": "@seabass", | ||
"rules": { | ||
"complexity": [2, 13] | ||
"complexity": [2, 13], | ||
"no-var": 0, | ||
"prefer-template": 0 | ||
} | ||
} |
42
index.js
@@ -105,24 +105,24 @@ 'use strict'; | ||
return format | ||
.replace('{yyyy}', yyyy) | ||
.replace('{yy}', yy) | ||
.replace('{m}', m) | ||
.replace('{mm}', mm) | ||
.replace('{Month}', month) | ||
.replace('{Mo}', month.substr(0, 3)) | ||
.replace('{d}', day) | ||
.replace('{dd}', dd) | ||
.replace('{ds}', dayWithSuffix) | ||
.replace('{Weekday}', weekday) | ||
.replace('{Day}', weekday.substr(0, 3)) | ||
.replace('{Dy}', weekday.substr(0, 2)) | ||
.replace('{D}', weekday[0]) | ||
.replace('{h24}', hours24) | ||
.replace('{hh24}', hh24) | ||
.replace('{h}', hours) | ||
.replace('{hh}', hh) | ||
.replace('{ampm}', ampm) | ||
.replace('{AMPM}', ampm.toUpperCase()) | ||
.replace('{Minutes}', minutes) | ||
.replace('{Seconds}', seconds); | ||
.replace(/\{yyyy\}/g, yyyy) | ||
.replace(/\{yy\}/g, yy) | ||
.replace(/\{m\}/g, m) | ||
.replace(/\{mm\}/g, mm) | ||
.replace(/\{Month\}/g, month) | ||
.replace(/\{Mo\}/g, month.substr(0, 3)) | ||
.replace(/\{d\}/g, day) | ||
.replace(/\{dd\}/g, dd) | ||
.replace(/\{ds\}/g, dayWithSuffix) | ||
.replace(/\{Weekday\}/g, weekday) | ||
.replace(/\{Day\}/g, weekday.substr(0, 3)) | ||
.replace(/\{Dy\}/g, weekday.substr(0, 2)) | ||
.replace(/\{D\}/g, weekday[0]) | ||
.replace(/\{h24\}/g, hours24) | ||
.replace(/\{hh24\}/g, hh24) | ||
.replace(/\{h\}/g, hours) | ||
.replace(/\{hh\}/g, hh) | ||
.replace(/\{ampm\}/g, ampm) | ||
.replace(/\{AMPM\}/g, ampm.toUpperCase()) | ||
.replace(/\{Minutes\}/g, minutes) | ||
.replace(/\{Seconds\}/g, seconds); | ||
}; |
{ | ||
"name": "s-date", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Tiny date/time formatter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -180,2 +180,13 @@ // ----- dependencies | ||
describe('repeats', function() { | ||
it('should parse all repeats', function() { | ||
expect(date('{d}{d}{d}', testDate)).to.equal('777'); | ||
expect(date('{d} {Seconds} {d}', testDate)).to.equal('7 04 7'); | ||
}); | ||
}); | ||
describe('multi-format', function() { | ||
@@ -182,0 +193,0 @@ |
Sorry, the diff of this file is not supported yet
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
18617
343