@financial-times/ft-date-format
Advanced tools
Comparing version 2.1.0 to 3.0.0
@@ -33,3 +33,7 @@ const months = '["' + 'January,February,March,April,May,June,July,August,September,October,November,December'.split(',').join('","') + '"]'; | ||
HH: 'pad2(date.getHours())', // 15 | ||
a: '(date.getHours() >= 12 ? "pm" : "am")' // pm | ||
a: '(date.getHours() >= 12 ? "pm" : "am")', // pm | ||
t: '`${(((date.getHours() + 11) % 12) + 1)}' | ||
+ ':' | ||
+ '${pad2(date.getMinutes())}' | ||
+ '${date.getHours() >= 12 ? "pm" : "am"}`' // 3:05pm | ||
}; | ||
@@ -36,0 +40,0 @@ |
@@ -119,2 +119,12 @@ /* eslint-env mocha */ | ||
}); | ||
it('returns an FT editorial-style time for `t` format', () => { | ||
proclaim.strictEqual(ftDateFormat.format(someTimes["midnight"], 't'), '12:01am'); | ||
proclaim.strictEqual(ftDateFormat.format(someTimes["1am"], 't'), '1:00am'); | ||
proclaim.strictEqual(ftDateFormat.format(someTimes["10am"], 't'), '10:00am'); | ||
proclaim.strictEqual(ftDateFormat.format(someTimes["midday"], 't'), '12:00pm'); | ||
proclaim.strictEqual(ftDateFormat.format(someTimes["1pm"], 't'), '1:00pm'); | ||
proclaim.strictEqual(ftDateFormat.format(someTimes["11pm"], 't'), '11:00pm'); | ||
proclaim.strictEqual(ftDateFormat.format(someDate, 't'), '11:12pm'); | ||
}); | ||
@@ -121,0 +131,0 @@ it('returns an unpadded 24hour clock value for `H` format', () => { |
{ | ||
"name": "@financial-times/ft-date-format", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Utility for formatting and updating dates for Financial-Times customer-facing products", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
43242
1557
791