Socket
Socket
Sign inDemoInstall

moment

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moment - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

lang/fi.js

6

lang/ca.js

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay : function () {

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay : '[I dag kl.] LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: "[Heute um] LT",

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay : '[Today at] LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay : function () {

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay : '[gaur] LT[etan]',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: "[Aujourd'hui à] LT",

8

lang/gl.js

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -35,3 +29,3 @@ sameDay : function () {

lastWeek : function () {
return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : '') + '] LT';
return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
},

@@ -38,0 +32,0 @@ sameElse : 'L'

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: '[Oggi alle] LT',

@@ -14,8 +14,5 @@ (function () {

},
meridiem : {
AM : '오전',
am : '오전',
PM : '오후',
pm : '오후'
},
meridiem : function(hour, minute, isUpper) {
return hour < 12 ? '오전' : '오후';
},
calendar : {

@@ -22,0 +19,0 @@ sameDay : '오늘 LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: '[I dag klokken] LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: '[Vandaag om] LT',

@@ -36,8 +36,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -44,0 +38,0 @@ sameDay: '[Dziś o] LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: '[Hoje às] LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay: '[Idag klockan] LT',

@@ -14,8 +14,2 @@ (function () {

},
meridiem : {
AM : 'AM',
am : 'am',
PM : 'PM',
pm : 'pm'
},
calendar : {

@@ -22,0 +16,0 @@ sameDay : '[bugün saat] LT',

@@ -8,20 +8,27 @@ (function () {

longDateFormat : {
LT : "h:mm A",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
LT : "Ah点mm",
L : "YYYY年MMMMD日",
LL : "YYYY年MMMMD日",
LLL : "YYYY年MMMMD日LT",
LLLL : "YYYY年MMMMD日ddddLT"
},
meridiem : {
AM : '上午',
am : '上午',
PM : '下午',
pm : '下午'
meridiem : function (hour, minute, isLower) {
if (hour < 9) {
return "早上";
} else if (hour < 11 && minute < 30) {
return "上午";
} else if (hour < 13 && minute < 30) {
return "中午";
} else if (hour < 18) {
return "下午";
} else {
return "晚上";
}
},
calendar : {
sameDay : '[今天] LT',
nextDay : '[明天] LT',
nextWeek : '[下]dddd LT',
lastDay : '[昨天] LT',
lastWeek : '[上]dddd LT',
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'

@@ -28,0 +35,0 @@ },

@@ -8,20 +8,27 @@ (function () {

longDateFormat : {
LT : "h:mm A",
L : "DD/MM/YYYY",
LL : "D MMMM YYYY",
LLL : "D MMMM YYYY LT",
LLLL : "dddd, D MMMM YYYY LT"
LT : "Ah點mm",
L : "YYYY年MMMMD日",
LL : "YYYY年MMMMD日",
LLL : "YYYY年MMMMD日LT",
LLLL : "YYYY年MMMMD日ddddLT"
},
meridiem : {
AM : '上午',
am : '上午',
PM : '下午',
pm : '下午'
meridiem : function (hour, minute, isLower) {
if (hour < 9) {
return "早上";
} else if (hour < 11 && minute < 30) {
return "上午";
} else if (hour < 13 && minute < 30) {
return "中午";
} else if (hour < 18) {
return "下午";
} else {
return "晚上";
}
},
calendar : {
sameDay : '[今天] LT',
nextDay : '[明天] LT',
nextWeek : '[下]dddd LT',
lastDay : '[昨天] LT',
lastWeek : '[上]dddd LT',
sameDay : '[今天]LT',
nextDay : '[明天]LT',
nextWeek : '[下]ddddLT',
lastDay : '[昨天]LT',
lastWeek : '[上]ddddLT',
sameElse : 'L'

@@ -57,2 +64,2 @@ },

}
}());
}());
// moment.js
// version : 1.5.0
// version : 1.5.1
// author : Tim Wood

@@ -21,3 +21,3 @@ // license : MIT

inputCharacters = /(\\)?([0-9]+|([a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+|([\+\-]\d\d:?\d\d))/gi,
isoRegex = /\d{4}.\d\d.\d\d(T(\d\d(.\d\d(.\d\d)?)?)?([\+\-]\d\d:?\d\d)?)?/,
isoRegex = /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d)?)?)?([\+\-]\d\d:?\d\d)?)?/,
isoFormat = 'YYYY-MM-DDTHH:mm:ssZ',

@@ -30,3 +30,3 @@ isoTimes = [

timezoneParseRegex = /([\+\-]|\d\d)/gi,
VERSION = "1.5.0",
VERSION = "1.5.1",
shortcuts = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|');

@@ -673,3 +673,3 @@

day : function (input) {
var day = this._d.getDay();
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
return input == null ? day :

@@ -676,0 +676,0 @@ this.add({ d : input - day });

{
"name": "moment",
"version": "1.5.0",
"version": "1.5.1",
"description": "Moment.js is a javascript date library that helps create, manipulate, and format dates without extending the `Date` prototype.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/timrwood/moment",

@@ -220,3 +220,14 @@ var moment = require("../../moment");

test.done();
},
"regression tests" : function(test) {
test.expect(1);
moment.lang('gl');
var lastWeek = moment().subtract({ d: 4 }).hours(1);
test.equal(lastWeek.calendar(), lastWeek.format('[o] dddd [pasado a] LT'), "1 o'clock bug");
test.done();
}
};
};

@@ -49,6 +49,6 @@ var moment = require("../../moment");

['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45 day of the year'],
['L', '14/02/2010'],
['LL', '14 二月 2010'],
['LLL', '14 二月 2010 3:25 下午'],
['LLLL', '星期日, 14 二月 2010 3:25 下午']
['L', '2010年二月14日'],
['LL', '2010年二月14日'],
['LLL', '2010年二月14日下午3点25'],
['LLLL', '2010年二月14日星期日下午3点25']
],

@@ -151,8 +151,8 @@ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),

test.equal(moment(a).calendar(), "今天 2:00 上午", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "今天 2:25 上午", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "今天 3:00 上午", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "明天 2:00 上午", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "今天 1:00 上午", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨天 2:00 上午", "yesterday at the same time");
test.equal(moment(a).calendar(), "今天早上2点00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "今天早上2点25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "今天早上3点00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "明天早上2点00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "今天早上1点00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨天早上2点00", "yesterday at the same time");
test.done();

@@ -170,7 +170,7 @@ },

m = moment().add({ d: i });
test.equal(m.calendar(), m.format('[下]dddd LT'), "Today + " + i + " days current time");
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[下]dddd LT'), "Today + " + i + " days beginning of day");
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[下]dddd LT'), "Today + " + i + " days end of day");
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days end of day");
}

@@ -186,7 +186,7 @@ test.done();

m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[上]dddd LT'), "Today - " + i + " days current time");
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[上]dddd LT'), "Today - " + i + " days beginning of day");
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[上]dddd LT'), "Today - " + i + " days end of day");
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days end of day");
}

@@ -210,4 +210,23 @@ test.done();

test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
test.done();
},
"meridiem" : function(test) {
test.expect(10);
moment.lang('zh-cn');
test.equal(moment([2011, 2, 23, 0, 0]).format('a'), "早上", "morning");
test.equal(moment([2011, 2, 23, 9, 0]).format('a'), "上午", "before noon");
test.equal(moment([2011, 2, 23, 12, 0]).format('a'), "中午", "noon");
test.equal(moment([2011, 2, 23, 13, 0]).format('a'), "下午", "after noon");
test.equal(moment([2011, 2, 23, 18, 0]).format('a'), "晚上", "night");
test.equal(moment([2011, 2, 23, 0, 0]).format('A'), "早上", "morning");
test.equal(moment([2011, 2, 23, 9, 0]).format('A'), "上午", "before noon");
test.equal(moment([2011, 2, 23, 12, 0]).format('A'), "中午", "noon");
test.equal(moment([2011, 2, 23, 13, 0]).format('A'), "下午", "afternoon");
test.equal(moment([2011, 2, 23, 18, 0]).format('A'), "晚上", "night");
test.done();
}
};

@@ -49,6 +49,6 @@ var moment = require("../../moment");

['t\\he DDDo \\d\\ay of t\\he ye\\ar', 'the 45 day of the year'],
['L', '14/02/2010'],
['LL', '14 二月 2010'],
['LLL', '14 二月 2010 3:25 下午'],
['LLLL', '星期日, 14 二月 2010 3:25 下午']
['L', '2010年二月14日'],
['LL', '2010年二月14日'],
['LLL', '2010年二月14日下午3點25'],
['LLLL', '2010年二月14日星期日下午3點25']
],

@@ -151,8 +151,8 @@ b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),

test.equal(moment(a).calendar(), "今天 2:00 上午", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "今天 2:25 上午", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "今天 3:00 上午", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "明天 2:00 上午", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "今天 1:00 上午", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨天 2:00 上午", "yesterday at the same time");
test.equal(moment(a).calendar(), "今天早上2點00", "today at the same time");
test.equal(moment(a).add({ m: 25 }).calendar(), "今天早上2點25", "Now plus 25 min");
test.equal(moment(a).add({ h: 1 }).calendar(), "今天早上3點00", "Now plus 1 hour");
test.equal(moment(a).add({ d: 1 }).calendar(), "明天早上2點00", "tomorrow at the same time");
test.equal(moment(a).subtract({ h: 1 }).calendar(), "今天早上1點00", "Now minus 1 hour");
test.equal(moment(a).subtract({ d: 1 }).calendar(), "昨天早上2點00", "yesterday at the same time");
test.done();

@@ -170,7 +170,7 @@ },

m = moment().add({ d: i });
test.equal(m.calendar(), m.format('[下]dddd LT'), "Today + " + i + " days current time");
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[下]dddd LT'), "Today + " + i + " days beginning of day");
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[下]dddd LT'), "Today + " + i + " days end of day");
test.equal(m.calendar(), m.format('[下]ddddLT'), "Today + " + i + " days end of day");
}

@@ -186,7 +186,7 @@ test.done();

m = moment().subtract({ d: i });
test.equal(m.calendar(), m.format('[上]dddd LT'), "Today - " + i + " days current time");
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days current time");
m.hours(0).minutes(0).seconds(0).milliseconds(0);
test.equal(m.calendar(), m.format('[上]dddd LT'), "Today - " + i + " days beginning of day");
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days beginning of day");
m.hours(23).minutes(59).seconds(59).milliseconds(999);
test.equal(m.calendar(), m.format('[上]dddd LT'), "Today - " + i + " days end of day");
test.equal(m.calendar(), m.format('[上]ddddLT'), "Today - " + i + " days end of day");
}

@@ -210,4 +210,23 @@ test.done();

test.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), "in 2 weeks");
test.done();
test.done();
},
"meridiem" : function(test) {
test.expect(10);
moment.lang('zh-cn');
test.equal(moment([2011, 2, 23, 0, 0]).format('a'), "早上", "morning");
test.equal(moment([2011, 2, 23, 9, 0]).format('a'), "上午", "before noon");
test.equal(moment([2011, 2, 23, 12, 0]).format('a'), "中午", "noon");
test.equal(moment([2011, 2, 23, 13, 0]).format('a'), "下午", "after noon");
test.equal(moment([2011, 2, 23, 18, 0]).format('a'), "晚上", "night");
test.equal(moment([2011, 2, 23, 0, 0]).format('A'), "早上", "morning");
test.equal(moment([2011, 2, 23, 9, 0]).format('A'), "上午", "before noon");
test.equal(moment([2011, 2, 23, 12, 0]).format('A'), "中午", "noon");
test.equal(moment([2011, 2, 23, 13, 0]).format('A'), "下午", "afternoon");
test.equal(moment([2011, 2, 23, 18, 0]).format('A'), "晚上", "night");
test.done();
}
};
};

@@ -50,2 +50,9 @@ var moment = require("../../moment");

"string from Date.toString" : function(test) {
test.expect(1);
var str = (new Date()).toString();
test.equal(moment(str).toString(), str, "Parsing a string from Date.prototype.toString should match moment.fn.toString");
test.done();
},
"string without format - json" : function(test) {

@@ -192,2 +199,2 @@ test.expect(5);

}
};
};

@@ -24,2 +24,15 @@ var moment = require("../../moment");

"format milliseconds" : function(test) {
test.expect(6);
var b = moment(new Date(2009, 1, 14, 15, 25, 50, 123));
test.equal(b.format('S'), '1', 'Deciseconds');
test.equal(b.format('SS'), '12', 'Centiseconds');
test.equal(b.format('SSS'), '123', 'Milliseconds');
b.milliseconds(789);
test.equal(b.format('S'), '7', 'Deciseconds');
test.equal(b.format('SS'), '78', 'Centiseconds');
test.equal(b.format('SSS'), '789', 'Milliseconds');
test.done();
},
"format timezone" : function(test) {

@@ -26,0 +39,0 @@ test.expect(4);

@@ -8,3 +8,3 @@ var moment = require('../../moment');

var MyObj = function() {};
MyObj.prototype.native = function() {
MyObj.prototype.toDate = function() {
return new Date();

@@ -11,0 +11,0 @@ }

@@ -5,3 +5,3 @@ var moment = require("../../moment");

"utc and local" : function(test) {
test.expect(5);
test.expect(7);

@@ -12,2 +12,3 @@ var m = moment(Date.UTC(2011, 1, 2, 3, 4, 5, 6));

test.equal(m.date(), 2, "the day should be correct for utc");
test.equal(m.day(), 3, "the date should be correct for utc");
test.equal(m.hours(), 3, "the hours should be correct for utc");

@@ -18,8 +19,11 @@

if (m.zone() > 180) {
test.equal(m.date(), 1, "the day should be correct for utc");
test.equal(m.date(), 1, "the date should be correct for local");
test.equal(m.day(), 2, "the day should be correct for local");
} else {
test.equal(m.date(), 2, "the day should be correct for utc");
test.equal(m.date(), 2, "the date should be correct for local");
test.equal(m.day(), 3, "the day should be correct for local");
}
var expected = (24 + 3 - Math.floor(m.zone() / 60)) % 24;
test.equal(m.hours(), expected, "the hours (" + m.hours() + ") should be correct for utc");
var zone = (m.zone() > 0) ? Math.floor(m.zone() / 60) : Math.ceil(m.zone() / 60);
var expected = (24 + 3 - zone) % 24;
test.equal(m.hours(), expected, "the hours (" + m.hours() + ") should be correct for local");
test.equal(moment().utc().zone(), 0, "timezone in utc should always be zero");

@@ -26,0 +30,0 @@ test.done();

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