Skip to content

Commit

Permalink
Build 2.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed Nov 11, 2017
1 parent 09b1c34 commit 328d51e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
13 changes: 7 additions & 6 deletions min/moment-with-locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ function get (mom, unit) {

function set$1 (mom, unit, value) {
if (mom.isValid() && !isNaN(value)) {
if (unit === 'FullYear' && isLeapYear(mom.year())) {
if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
}
else {
Expand Down Expand Up @@ -1914,10 +1914,11 @@ function defineLocale (name, config) {

function updateLocale(name, config) {
if (config != null) {
var locale, parentConfig = baseConfig;
var locale, tmpLocale, parentConfig = baseConfig;
// MERGE
if (locales[name] != null) {
parentConfig = locales[name]._config;
tmpLocale = loadLocale(name);
if (tmpLocale != null) {
parentConfig = tmpLocale._config;
}
config = mergeConfigs(parentConfig, config);
locale = new Locale(config);
Expand Down Expand Up @@ -4471,12 +4472,12 @@ addParseToken('x', function (input, array, config) {
// Side effect imports

//! moment.js
//! version : 2.19.1
//! version : 2.19.2
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com

hooks.version = '2.19.1';
hooks.version = '2.19.2';

setHookCallback(createLocal);

Expand Down
2 changes: 1 addition & 1 deletion min/moment-with-locales.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion min/moment.min.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions min/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -63259,6 +63259,10 @@ test('year setter', function (assert) {
var b = moment([2012, 1, 29]);
assert.equal(moment(b).year(2017).format('YYYY-MM-DD'), '2017-02-28', 'set from last day of february on a leap year to a non leap year');
assert.equal(moment(b).year(2004).format('YYYY-MM-DD'), '2004-02-29', 'set from last day of february on a leap year to a leap year');

var c = moment([2012, 9, 4]);
assert.equal(moment(c).year(2017).format('YYYY-MM-DD'), '2017-10-04', 'set from a random day on a leap year to a non leap year');
assert.equal(moment(c).year(2004).format('YYYY-MM-DD'), '2004-10-04', 'set from a random day on a leap year to a leap year');
});

test('object set ordering', function (assert) {
Expand Down Expand Up @@ -67753,6 +67757,14 @@ test('months', function (assert) {
assert.ok(moment.utc('2015-01-01', 'YYYY-MM-DD').format('MMMM'), 'First', 'months uses child');
});

test('update existing locale', function (assert) {
moment.updateLocale('de', {
monthsShort: ['JAN', 'FEB', 'MÄR', 'APR', 'MAI', 'JUN', 'JUL', 'AUG', 'SEP', 'OKT', 'NOV', 'DEZ']
});
assert.equal(moment('2017-02-01').format('YYYY MMM MMMM'), '2017 FEB Februar');
moment.updateLocale('de', null);
});

})));


Expand Down
13 changes: 7 additions & 6 deletions moment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! moment.js
//! version : 2.19.1
//! version : 2.19.2
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
Expand Down Expand Up @@ -814,7 +814,7 @@ function get (mom, unit) {

function set$1 (mom, unit, value) {
if (mom.isValid() && !isNaN(value)) {
if (unit === 'FullYear' && isLeapYear(mom.year())) {
if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
}
else {
Expand Down Expand Up @@ -1920,10 +1920,11 @@ function defineLocale (name, config) {

function updateLocale(name, config) {
if (config != null) {
var locale, parentConfig = baseConfig;
var locale, tmpLocale, parentConfig = baseConfig;
// MERGE
if (locales[name] != null) {
parentConfig = locales[name]._config;
tmpLocale = loadLocale(name);
if (tmpLocale != null) {
parentConfig = tmpLocale._config;
}
config = mergeConfigs(parentConfig, config);
locale = new Locale(config);
Expand Down Expand Up @@ -4477,7 +4478,7 @@ addParseToken('x', function (input, array, config) {
// Side effect imports


hooks.version = '2.19.1';
hooks.version = '2.19.2';

setHookCallback(createLocal);

Expand Down

0 comments on commit 328d51e

Please sign in to comment.