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

@financial-times/ft-date-format

Package Overview
Dependencies
Maintainers
11
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/ft-date-format - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

6

index.js

@@ -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', () => {

2

package.json
{
"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",

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