From 48dfaa9c266b1a6f1164ff1337c71e5541edbafc Mon Sep 17 00:00:00 2001 From: "Ian W. Remmel" Date: Fri, 13 Sep 2013 19:18:59 -0400 Subject: [PATCH] rerolled to modify `aspNetTimeSpanJsonRegex` rather than introduce a new regex pattern --- moment.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/moment.js b/moment.js index 69b96409c..1dd866f03 100644 --- a/moment.js +++ b/moment.js @@ -21,9 +21,7 @@ // ASP.NET json date format regex aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, - aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/, - - twentyFourHourTimeRegex = /(\d{2})\:(\d{2})/, + aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, // 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, @@ -1127,7 +1125,6 @@ isNumber = (typeof input === 'number'), duration = (isDuration ? input._input : (isNumber ? {} : input)), matched = aspNetTimeSpanJsonRegex.exec(input), - twentyFourHourMatched = twentyFourHourTimeRegex.exec(input), sign, ret; @@ -1147,15 +1144,6 @@ 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 - }; } ret = new Duration(duration); -- 2.47.2