From: Tim Wood Date: Fri, 8 Feb 2013 19:23:09 +0000 (-0800) Subject: merging in develop X-Git-Tag: 2.1.0~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46200a34cbc5d9c058d5be96f0989fabf504eee2;p=thirdparty%2Fmoment.git merging in develop --- 46200a34cbc5d9c058d5be96f0989fabf504eee2 diff --cc lang/da.js index f50a08376,4f4141f90..3f4c459ab --- a/lang/da.js +++ b/lang/da.js @@@ -1,54 -1,46 +1,46 @@@ // moment.js language configuration // language : danish (da) // author : Ulrik Nielsen : https://github.com/mrbase - (function () { - var lang = { - months : "Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"), - monthsShort : "Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"), - weekdays : "Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"), - weekdaysShort : "Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"), - weekdaysMin : "Sø_Ma_Ti_On_To_Fr_Lø".split("_"), - longDateFormat : { - LT : "HH:mm", - L : "DD/MM/YYYY", - LL : "D MMMM YYYY", - LLL : "D MMMM YYYY LT", - LLLL : "dddd D. MMMM, YYYY LT" - }, - calendar : { - sameDay : '[I dag kl.] LT', - nextDay : '[I morgen kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[I går kl.] LT', - lastWeek : '[sidste] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : "om %s", - past : "%s siden", - s : "få sekunder", - m : "et minut", - mm : "%d minutter", - h : "en time", - hh : "%d timer", - d : "en dag", - dd : "%d dage", - M : "en måned", - MM : "%d måneder", - y : "et år", - yy : "%d år" - }, - ordinal : function (number) { - return '.'; - } - }; - // Node - if (typeof module !== 'undefined' && module.exports) { - module.exports = lang; + require('../moment').lang('da', { + months : "Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"), + monthsShort : "Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"), + weekdays : "Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"), + weekdaysShort : "Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"), + weekdaysMin : "Sø_Ma_Ti_On_To_Fr_Lø".split("_"), + longDateFormat : { - LT : "h:mm A", ++ LT : "HH:mm", + L : "DD/MM/YYYY", + LL : "D MMMM YYYY", - LLL : "D MMMM YYYY h:mm A", - LLLL : "dddd D. MMMM, YYYY h:mm A" ++ LLL : "D MMMM YYYY LT", ++ LLLL : "dddd D. MMMM, YYYY LT" + }, + calendar : { + sameDay : '[I dag kl.] LT', + nextDay : '[I morgen kl.] LT', + nextWeek : 'dddd [kl.] LT', + lastDay : '[I går kl.] LT', + lastWeek : '[sidste] dddd [kl] LT', + sameElse : 'L' + }, + relativeTime : { + future : "om %s", + past : "%s siden", + s : "få sekunder", - m : "minut", ++ m : "et minut", + mm : "%d minutter", - h : "time", ++ h : "en time", + hh : "%d timer", - d : "dag", ++ d : "en dag", + dd : "%d dage", - M : "månede", ++ M : "en måned", + MM : "%d måneder", - y : "år", ++ y : "et år", + yy : "%d år" + }, + ordinal : '%d.', + week : { + dow : 1, // Monday is the first day of the week. + doy : 4 // The week that contains Jan 4th is the first week of the year. } - // Browser - if (typeof window !== 'undefined' && this.moment && this.moment.lang) { - this.moment.lang('da', lang); - } - }()); + }); diff --cc readme.md index 09d368430,d2ec95a4b..3a751987a --- a/readme.md +++ b/readme.md @@@ -1,20 -1,26 +1,32 @@@ - [Moment.js](http://momentjs.com) - ================================ - A lightweight javascript date library for parsing, validating, manipulating, and formatting dates. - ### [Check out the website](http://momentjs.com) + # [Documentation](http://momentjs.com/docs/) + + Upgrading to 2.0.0 + ================== + + There are a number of small backwards incompatible changes with version 2.0.0. + + [See them and their descriptions here](https://gist.github.com/timrwood/e72f2eef320ed9e37c51#backwards-incompatible-changes) + + Changed language ordinal method to return the number + ordinal instead of just the ordinal. + + Changed two digit year parsing cutoff to match strptime. + + Removed `moment#sod` and `moment#eod` in favor of `moment#startOf` and `moment#endOf`. - ### [Read the documentation](http://momentjs.com/docs/) + Removed `moment.humanizeDuration()` in favor of `moment.duration().humanize()`. - ### [Run the unit tests](http://momentjs.com/test/) + Removed the lang data objects from the top level namespace. + + Duplicate `Date` passed to `moment()` instead of referencing it. +Travis Build Status +=================== + +Develop [![Build Status](https://travis-ci.org/timrwood/moment.png?branch=develop)](https://travis-ci.org/timrwood/moment) + +Master [![Build Status](https://travis-ci.org/timrwood/moment.png)](https://travis-ci.org/timrwood/moment) Upgrading to 1.6.0 ================== diff --cc test/lang/da.js index 004d6c51e,deed24c8d..23916a993 --- a/test/lang/da.js +++ b/test/lang/da.js @@@ -29,10 -38,9 +38,9 @@@ exports["lang:da"] = }, "format" : function(test) { - test.expect(18); - moment.lang('da'); + test.expect(22); var a = [ - ['dddd \\den MMMM Do YYYY, h:mm:ss a', 'Søndag den Februar 14. 2010, 3:25:50 pm'], + ['dddd \\den Do MMMM YYYY, h:mm:ss a', 'Søndag den 14. Februar 2010, 3:25:50 pm'], ['ddd hA', 'Søn 3PM'], ['M Mo MM MMMM MMM', '2 2. 02 Februar Feb'], ['YYYY YY', '2010 10'], @@@ -45,11 -53,15 +53,15 @@@ ['m mm', '25 25'], ['s ss', '50 50'], ['a A', 'pm PM'], - ['[den] DDDo \\d\\ag på året', 'den 45. dag på året'], + ['[den] DDDo \\d\\ag på året', 'den 45. dag på året'], ['L', '14/02/2010'], ['LL', '14 Februar 2010'], - ['LLL', '14 Februar 2010 3:25 PM'], - ['LLLL', 'Søndag 14. Februar, 2010 3:25 PM'], + ['LLL', '14 Februar 2010 15:25'], - ['LLLL', 'Søndag 14. Februar, 2010 15:25'] ++ ['LLLL', 'Søndag 14. Februar, 2010 15:25'], + ['l', '14/2/2010'], + ['ll', '14 Feb 2010'], - ['lll', '14 Feb 2010 3:25 PM'], - ['llll', 'Søn 14. Feb, 2010 3:25 PM'] ++ ['lll', '14 Feb 2010 15:25'], ++ ['llll', 'Søn 14. Feb, 2010 15:25'] ], b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), i; @@@ -123,15 -132,14 +132,14 @@@ "from" : function(test) { test.expect(30); - moment.lang('da'); var start = moment([2007, 1, 28]); test.equal(start.from(moment([2007, 1, 28]).add({s:44}), true), "få sekunder", "44 seconds = a few seconds"); - test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "minut", "45 seconds = a minute"); - test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "minut", "89 seconds = a minute"); + test.equal(start.from(moment([2007, 1, 28]).add({s:45}), true), "et minut", "45 seconds = a minute"); + test.equal(start.from(moment([2007, 1, 28]).add({s:89}), true), "et minut", "89 seconds = a minute"); test.equal(start.from(moment([2007, 1, 28]).add({s:90}), true), "2 minutter", "90 seconds = 2 minutes"); test.equal(start.from(moment([2007, 1, 28]).add({m:44}), true), "44 minutter", "44 minutes = 44 minutes"); - test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "time", "45 minutes = an hour"); - test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "time", "89 minutes = an hour"); + test.equal(start.from(moment([2007, 1, 28]).add({m:45}), true), "en time", "45 minutes = an hour"); + test.equal(start.from(moment([2007, 1, 28]).add({m:89}), true), "en time", "89 minutes = an hour"); test.equal(start.from(moment([2007, 1, 28]).add({m:90}), true), "2 timer", "90 minutes = 2 hours"); test.equal(start.from(moment([2007, 1, 28]).add({h:5}), true), "5 timer", "5 hours = 5 hours"); test.equal(start.from(moment([2007, 1, 28]).add({h:21}), true), "21 timer", "21 hours = 21 hours"); diff --cc test/lang/fr-ca.js index df1de8d6d,e5694ee30..feb238fcb --- a/test/lang/fr-ca.js +++ b/test/lang/fr-ca.js @@@ -209,8 -234,7 +234,9 @@@ exports["lang:fr-ca"] = "same last week" : function(test) { test.expect(15); - moment.lang('fr'); + ++ var i, m; + for (i = 2; i < 7; i++) { m = moment().subtract({ d: i }); test.equal(m.calendar(), m.format('dddd [dernier à] LT'), "Today - " + i + " days current time");