"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "min/moment-with-locales.js" between
moment-2.29.2.tar.gz and moment-2.29.3.tar.gz

About: Moment.js is a JavaScript date library for parsing, validating, manipulating, and formatting dates.

moment-with-locales.js  (moment-2.29.2):moment-with-locales.js  (moment-2.29.3)
skipping to change at line 5632 skipping to change at line 5632
addRegexToken('X', matchTimestamp); addRegexToken('X', matchTimestamp);
addParseToken('X', function (input, array, config) { addParseToken('X', function (input, array, config) {
config._d = new Date(parseFloat(input) * 1000); config._d = new Date(parseFloat(input) * 1000);
}); });
addParseToken('x', function (input, array, config) { addParseToken('x', function (input, array, config) {
config._d = new Date(toInt(input)); config._d = new Date(toInt(input));
}); });
//! moment.js //! moment.js
hooks.version = '2.29.2'; hooks.version = '2.29.3';
setHookCallback(createLocal); setHookCallback(createLocal);
hooks.fn = proto; hooks.fn = proto;
hooks.min = min; hooks.min = min;
hooks.max = max; hooks.max = max;
hooks.now = now; hooks.now = now;
hooks.utc = createUTC; hooks.utc = createUTC;
hooks.unix = createUnix; hooks.unix = createUnix;
hooks.months = listMonths; hooks.months = listMonths;
skipping to change at line 15769 skipping to change at line 15769
if ( if (
number % 10 >= 1 && number % 10 >= 1 &&
number % 10 <= 4 && number % 10 <= 4 &&
(number % 100 < 10 || number % 100 >= 20) (number % 100 < 10 || number % 100 >= 20)
) { ) {
return number % 10 === 1 ? wordKey[0] : wordKey[1]; return number % 10 === 1 ? wordKey[0] : wordKey[1];
} }
return wordKey[2]; return wordKey[2];
}, },
translate: function (number, withoutSuffix, key, isFuture) { translate: function (number, withoutSuffix, key, isFuture) {
var wordKey = translator$1.words[key]; var wordKey = translator$1.words[key],
word;
if (key.length === 1) { if (key.length === 1) {
// Nominativ // Nominativ
if (key === 'y' && withoutSuffix) return 'једна година'; if (key === 'y' && withoutSuffix) return 'једна година';
return isFuture || withoutSuffix ? wordKey[0] : wordKey[1]; return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
} }
const word = translator$1.correctGrammaticalCase(number, wordKey); word = translator$1.correctGrammaticalCase(number, wordKey);
// Nominativ // Nominativ
if (key === 'yy' && withoutSuffix && word === 'годину') { if (key === 'yy' && withoutSuffix && word === 'годину') {
return number + ' година'; return number + ' година';
} }
return number + ' ' + word; return number + ' ' + word;
}, },
}; };
hooks.defineLocale('sr-cyrl', { hooks.defineLocale('sr-cyrl', {
skipping to change at line 15891 skipping to change at line 15892
if ( if (
number % 10 >= 1 && number % 10 >= 1 &&
number % 10 <= 4 && number % 10 <= 4 &&
(number % 100 < 10 || number % 100 >= 20) (number % 100 < 10 || number % 100 >= 20)
) { ) {
return number % 10 === 1 ? wordKey[0] : wordKey[1]; return number % 10 === 1 ? wordKey[0] : wordKey[1];
} }
return wordKey[2]; return wordKey[2];
}, },
translate: function (number, withoutSuffix, key, isFuture) { translate: function (number, withoutSuffix, key, isFuture) {
var wordKey = translator$2.words[key]; var wordKey = translator$2.words[key],
word;
if (key.length === 1) { if (key.length === 1) {
// Nominativ // Nominativ
if (key === 'y' && withoutSuffix) return 'jedna godina'; if (key === 'y' && withoutSuffix) return 'jedna godina';
return isFuture || withoutSuffix ? wordKey[0] : wordKey[1]; return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
} }
const word = translator$2.correctGrammaticalCase(number, wordKey); word = translator$2.correctGrammaticalCase(number, wordKey);
// Nominativ // Nominativ
if (key === 'yy' && withoutSuffix && word === 'godinu') { if (key === 'yy' && withoutSuffix && word === 'godinu') {
return number + ' godina'; return number + ' godina';
} }
return number + ' ' + word; return number + ' ' + word;
}, },
}; };
hooks.defineLocale('sr', { hooks.defineLocale('sr', {
 End of changes. 5 change blocks. 
5 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)