]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
converted to spaces
authorIan Remmel <design@ianwremmel.com>
Mon, 9 Sep 2013 07:45:31 +0000 (21:45 -1000)
committerIan Remmel <design@ianwremmel.com>
Mon, 9 Sep 2013 07:46:47 +0000 (21:46 -1000)
moment.js
test/moment/duration.js

index 179ba82f447910ecfe217a9d45b6e087e58150be..21863fbc783bad5fc26ed8407041ab009bae7445 100644 (file)
--- a/moment.js
+++ b/moment.js
@@ -23,7 +23,7 @@
         aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
         aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,
 
-       twentyFourHourTimeRegex = /(\d{2})\:(\d{2})/,
+    twentyFourHourTimeRegex = /(\d{2})\:(\d{2})/,
 
         // format tokens
         formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
             isNumber = (typeof input === 'number'),
             duration = (isDuration ? input._input : (isNumber ? {} : input)),
             matched = aspNetTimeSpanJsonRegex.exec(input),
-           twentyFourHourMatched = twentyFourHourTimeRegex.exec(input),
+        twentyFourHourMatched = twentyFourHourTimeRegex.exec(input),
             sign,
             ret;
 
                 s: ~~matched[5] * sign,
                 ms: ~~matched[6] * sign
             };
-       } else if (twentyFourHourMatched) {
-           duration = {
-               y: 0,
-               d: 0,
-               h: ~~twentyFourHourMatched[1],
-               m: ~~twentyFourHourMatched[2],
-               s: 0,
-               ms: 0
-           };
+        } else if (twentyFourHourMatched) {
+            duration = {
+            y: 0,
+            d: 0,
+            h: ~~twentyFourHourMatched[1],
+            m: ~~twentyFourHourMatched[2],
+            s: 0,
+            ms: 0
+            };
         }
 
         ret = new Duration(duration);
index 434c4faa493a85b9c695c0bfc5983ec7da04177c..c3ead0656b9c7bd4ea4ed37f3fe5ea8bc1a87eb9 100644 (file)
@@ -140,25 +140,25 @@ exports.duration = {
     },
 
     "instantiation from 24-hour time zero" : function(test) {
-       test.expect(6);
-       test.equal(moment.duration("00:00").years(), 0, "0 years");
-       test.equal(moment.duration("00:00").days(), 0, "0 days");
-       test.equal(moment.duration("00:00").hours(), 0, "0 hours");
-       test.equal(moment.duration("00:00").minutes(), 0, "0 minutes");
-       test.equal(moment.duration("00:00").seconds(), 0, "0 seconds");
-       test.equal(moment.duration("00:00").milliseconds(), 0, "0 milliseconds");
-       test.done();
+        test.expect(6);
+        test.equal(moment.duration("00:00").years(), 0, "0 years");
+        test.equal(moment.duration("00:00").days(), 0, "0 days");
+        test.equal(moment.duration("00:00").hours(), 0, "0 hours");
+        test.equal(moment.duration("00:00").minutes(), 0, "0 minutes");
+        test.equal(moment.duration("00:00").seconds(), 0, "0 seconds");
+        test.equal(moment.duration("00:00").milliseconds(), 0, "0 milliseconds");
+        test.done();
     },
 
      "instantiation from 24-hour time" : function(test) {
-       test.expect(6);
-       test.equal(moment.duration("13:45").years(), 0, "0 years");
-       test.equal(moment.duration("13:45").days(), 0, "0 days");
-       test.equal(moment.duration("13:45").hours(), 13, "13 hours");
-       test.equal(moment.duration("13:45").minutes(), 45, "45 minutes");
-       test.equal(moment.duration("13:45").seconds(), 0, "0 seconds");
-       test.equal(moment.duration("13:45").milliseconds(), 0, "0 milliseconds");
-       test.done();
+        test.expect(6);
+        test.equal(moment.duration("13:45").years(), 0, "0 years");
+        test.equal(moment.duration("13:45").days(), 0, "0 days");
+        test.equal(moment.duration("13:45").hours(), 13, "13 hours");
+        test.equal(moment.duration("13:45").minutes(), 45, "45 minutes");
+        test.equal(moment.duration("13:45").seconds(), 0, "0 seconds");
+        test.equal(moment.duration("13:45").milliseconds(), 0, "0 milliseconds");
+        test.done();
     },
 
     "instatiation from serialized C# TimeSpan zero" : function (test) {