Socket
Socket
Sign inDemoInstall

javascript-time-ago

Package Overview
Dependencies
1
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.9 to 2.0.10

locale-more-styles/de/tiny.json

5

CHANGELOG.md

@@ -0,1 +1,6 @@

2.0.10 / 16.07.2020
==================
* Added `"tiny"` time labels for `"de"` locale.
2.0.0 / 14.01.2018

@@ -2,0 +7,0 @@ ==================

24

commonjs/style/twitter.test.js

@@ -17,4 +17,4 @@ "use strict";

it('should fallback from "tiny" to "narrow" for Twitter style for autogenerated locales', function () {
var timeAgo = new _JavascriptTimeAgo.default('de');
timeAgo.format(Date.now() - 3 * 60 * 60 * 1000, 'twitter').should.equal('vor 3 Std.');
var timeAgo = new _JavascriptTimeAgo.default('fr');
timeAgo.format(Date.now() - 3 * 60 * 60 * 1000, 'twitter').should.equal('-3 h');
});

@@ -85,6 +85,22 @@ it('should format Twitter style relative time (English)', function () {

elapsed(59.51).should.equal('1분');
elapsed(59.51 * 60).should.equal('1시간'); // elapsed(day + 62 * 60).should.equal('9 апр.')
// elapsed(year).should.equal('11 апр. 2015 г.')
elapsed(59.51 * 60).should.equal('1시간');
elapsed(_gradation.day + 62 * 60).should.equal('4월 9일');
elapsed(_gradation.year).should.equal('2015년 4월 11일');
});
it('should format Twitter style relative time (German)', function () {
var timeAgo = new _JavascriptTimeAgo.default('de');
var now = new Date(2016, 3, 10, 22, 59).getTime();
var elapsed = function elapsed(time) {
return timeAgo.format(now - time * 1000, _objectSpread({
now: now
}, _twitter.default));
};
elapsed(59.51).should.equal('1 Min.');
elapsed(59.51 * 60).should.equal('1 Std.');
elapsed(_gradation.day + 62 * 60).should.equal('9. Apr.');
elapsed(_gradation.year).should.equal('11. Apr. 2015');
});
});
//# sourceMappingURL=twitter.test.js.map

@@ -12,4 +12,5 @@ var locale = require('relative-time-format/locale/de')

'long-convenient': require('../../locale-more-styles/de/long-convenient.json'),
'tiny': require('../../locale-more-styles/de/tiny.json'),
// Quantifier.
quantify: locale.quantify
}

@@ -10,4 +10,4 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

it('should fallback from "tiny" to "narrow" for Twitter style for autogenerated locales', function () {
var timeAgo = new JavascriptTimeAgo('de');
timeAgo.format(Date.now() - 3 * 60 * 60 * 1000, 'twitter').should.equal('vor 3 Std.');
var timeAgo = new JavascriptTimeAgo('fr');
timeAgo.format(Date.now() - 3 * 60 * 60 * 1000, 'twitter').should.equal('-3 h');
});

@@ -78,6 +78,22 @@ it('should format Twitter style relative time (English)', function () {

elapsed(59.51).should.equal('1분');
elapsed(59.51 * 60).should.equal('1시간'); // elapsed(day + 62 * 60).should.equal('9 апр.')
// elapsed(year).should.equal('11 апр. 2015 г.')
elapsed(59.51 * 60).should.equal('1시간');
elapsed(day + 62 * 60).should.equal('4월 9일');
elapsed(year).should.equal('2015년 4월 11일');
});
it('should format Twitter style relative time (German)', function () {
var timeAgo = new JavascriptTimeAgo('de');
var now = new Date(2016, 3, 10, 22, 59).getTime();
var elapsed = function elapsed(time) {
return timeAgo.format(now - time * 1000, _objectSpread({
now: now
}, twitterStyle));
};
elapsed(59.51).should.equal('1 Min.');
elapsed(59.51 * 60).should.equal('1 Std.');
elapsed(day + 62 * 60).should.equal('9. Apr.');
elapsed(year).should.equal('11. Apr. 2015');
});
});
//# sourceMappingURL=twitter.test.js.map

2

package.json
{
"name": "javascript-time-ago",
"version": "2.0.9",
"version": "2.0.10",
"description": "International highly customizable relative date/time formatting",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc