]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
merging #572
authorTim Wood <washwithcare@gmail.com>
Tue, 5 Feb 2013 18:57:07 +0000 (10:57 -0800)
committerTim Wood <washwithcare@gmail.com>
Tue, 5 Feb 2013 18:57:07 +0000 (10:57 -0800)
1  2 
moment.js
test/moment/lang.js
test/moment/mutable.js
test/moment/sod_eod.js

diff --cc moment.js
Simple merge
Simple merge
Simple merge
index 272eb2f556f7e5bc7832de650c84e520401217df,b1420f03f4843e248e8d46fc78d670f4c77f2682..8ff70d00d49c90a918e7127dd646fd7617210df9
@@@ -102,40 -65,6 +65,40 @@@ exports.end_start_of = 
          test.done();
      },
  
-     
 +    "start of week" : function(test) {
 +        test.expect(9);
 +
 +        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('week');
 +        var ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).startOf('weeks');
 +        test.equal(+m, +ms, "Plural or singular should work");
 +        test.equal(m.year(), 2011, "keep the year");
 +        test.equal(m.month(), 0, "rolls back to January");
 +        test.equal(m.day(), 0, "set day of week");
 +        test.equal(m.date(), 30, "set correct date");
 +        test.equal(m.hours(), 0, "strip out the hours");
 +        test.equal(m.minutes(), 0, "strip out the minutes");
 +        test.equal(m.seconds(), 0, "strip out the seconds");
 +        test.equal(m.milliseconds(), 0, "strip out the milliseconds");
 +        test.done();
 +    },
-     
++
 +    "end of week" : function(test) {
 +        test.expect(9);
 +
 +        var m = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('week');
 +        var ms = moment(new Date(2011, 1, 2, 3, 4, 5, 6)).endOf('weeks');
 +        test.equal(+m, +ms, "Plural or singular should work");
 +        test.equal(m.year(), 2011, "keep the year");
 +        test.equal(m.month(), 1, "keep the month");
 +        test.equal(m.day(), 6, "set the day of the week");
 +        test.equal(m.date(), 5, "set the day");
 +        test.equal(m.hours(), 23, "set the hours");
 +        test.equal(m.minutes(), 59, "set the minutes");
 +        test.equal(m.seconds(), 59, "set the seconds");
 +        test.equal(m.milliseconds(), 999, "set the seconds");
 +        test.done();
 +    },
++
      "start of day" : function(test) {
          test.expect(8);
  
          test.equal(m.year(), 2011, "keep the year");
          test.equal(m.month(), 1, "keep the month");
          test.equal(m.date(), 2, "keep the day");
-         test.equal(m.hours(), 3, "keep the hours"); 
-         test.equal(m.minutes(), 4, "keep the minutes"); 
-         test.equal(m.seconds(), 5, "keep the seconds"); 
+         test.equal(m.hours(), 3, "keep the hours");
+         test.equal(m.minutes(), 4, "keep the minutes");
+         test.equal(m.seconds(), 5, "keep the seconds");
          test.equal(m.milliseconds(), 999, "set the seconds");
          test.done();
--    },
++    }
  };