]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
merging in develop
authorTim Wood <washwithcare@gmail.com>
Fri, 8 Feb 2013 19:23:09 +0000 (11:23 -0800)
committerTim Wood <washwithcare@gmail.com>
Fri, 8 Feb 2013 19:23:09 +0000 (11:23 -0800)
1  2 
CONTRIBUTING.md
lang/da.js
readme.md
test/lang/da.js
test/lang/fr-ca.js

diff --cc CONTRIBUTING.md
Simple merge
diff --cc lang/da.js
index f50a08376b312a03b5b60d4694c8a66420e82c3e,4f4141f90de9c469f252f5a1188105a837e3dc60..3f4c459aba025333ab6a00d249f8cebbfccf737d
@@@ -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 09d3684305cabcb4076516dfe96131b34b4cde87,d2ec95a4b0d5986bb5aecc6e2b6a525d0eb55568..3a751987a24cddec1d4e4c94e7c39d66fbbd2974
+++ 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 004d6c51ee7e679d5700d4f6a855fc062a63fb7d,deed24c8da2e7fe77046991438ef3796a6f169c4..23916a993d580e8f0b887e0dc9cd34bca964aa8d
@@@ -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'],
                  ['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;
  
      "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");
index df1de8d6d842b1dde95c715a00dbfdf809719bf1,e5694ee3003bd1608e2af146831c0575f8858d3f..feb238fcb45565fed05c5e4936837415429ca280
@@@ -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");