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

ember-moment

Package Overview
Dependencies
Maintainers
6
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-moment - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

CHANGELOG.md

11

addon/helpers/moment.js

@@ -9,4 +9,6 @@ import Ember from 'ember';

if (length === 1) {
throw new TypeError('Invalid Number of arguments, expected atleast 1');
if (length === 1 || length > 4) {
// there's one extra argument that handlebars adds to the end,
// which explains the difference in what we are checking and the error we are raising
throw new TypeError('Invalid Number of arguments, expected at least 1 and at most 3');
}

@@ -17,3 +19,6 @@

if (length === 2) {
args.push('LLLL');
output = 'LLLL';
}
else if (length === 3) {
output = maybeOutput;
} else if (length > 3) {

@@ -20,0 +25,0 @@ args.push(maybeInput);

{
"name": "ember-moment",
"version": "0.2.0",
"version": "1.0.0",
"description": "Moment.js template helpers for ember",

@@ -5,0 +5,0 @@ "directories": {

@@ -9,3 +9,4 @@ import Ember from 'ember';

computedDate: moment('date', 'MM/DD/YY hh:mm:ss'),
computedOneHourAgo: ago('lastHour')
computedOneHourAgo: ago('lastHour'),
usIndependenceDay: new Date(1776, 6, 4, 12, 0, 0)
});

@@ -11,14 +11,16 @@ import date from './date';

test('one arg (date)', function() {
equal(moment(date(0), FAKE_HANDLEBARS_CONTEXT), '1969-12-31T19:00:00-05:00');
equal(moment(date(60*60*24), FAKE_HANDLEBARS_CONTEXT), '1969-12-31T19:01:26-05:00');
equal(moment(date(new Date(0)), FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:00 PM');
equal(moment(date(new Date(60*60*24)), FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:01 PM');
});
test('two args (date, outputFormat)', function() {
equal(moment(date(0), 'LLLL', FAKE_HANDLEBARS_CONTEXT), '1969-12-31T19:00:00-05:00');
equal(moment(date(60*60*24), 'LLLL', FAKE_HANDLEBARS_CONTEXT), '1969-12-31T19:01:26-05:00');
equal(moment(date(new Date(0)), 'LLLL', FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:00 PM');
equal(moment(date(new Date(60*60*24)), 'LLLL', FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:01 PM');
equal(moment(Date.parse('2011-10-10T14:48:00-05:00'), 'MMMM D, YYYY', FAKE_HANDLEBARS_CONTEXT), 'October 10, 2011');
});
test('three args (date, outputFormat, inputFormat)', function() {
equal(moment(date(0), 'LLLL', 'LLLL', FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:00 PM');
equal(moment(date(60*60*24), 'LLLL', 'LLLL', FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:01 PM');
equal(moment('October 10, 2011', 'LLLL', 'MMMM D, YYYY', FAKE_HANDLEBARS_CONTEXT), 'Monday, October 10, 2011 12:00 AM');
equal(moment('5/3/10', 'MMMM D, YYYY', 'M/D/YY', FAKE_HANDLEBARS_CONTEXT), 'May 3, 2010');
equal(moment(date(new Date(0)), 'LLLL', 'LLLL', FAKE_HANDLEBARS_CONTEXT), 'Wednesday, December 31, 1969 7:00 PM');
});

Sorry, the diff of this file is not supported yet

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