From: Matt Grande Date: Tue, 21 Oct 2014 14:31:27 +0000 (-0400) Subject: Add basic support for Local Time with Seconds (LTS) token. Not yet localized. X-Git-Tag: 2.8.4~24^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14f66816c9a88f1c7b387b53ecab92c2ad3d138f;p=thirdparty%2Fmoment.git Add basic support for Local Time with Seconds (LTS) token. Not yet localized. --- diff --git a/moment.js b/moment.js index a9e011927..b25397f01 100644 --- a/moment.js +++ b/moment.js @@ -45,7 +45,7 @@ // format tokens formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g, - localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g, + localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, // parsing token regexes parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 @@ -880,6 +880,7 @@ }, _longDateFormat : { + LTS : 'h:mm:ss A', LT : 'h:mm A', L : 'MM/DD/YYYY', LL : 'MMMM D, YYYY', diff --git a/test/moment/create.js b/test/moment/create.js index f8f7ac77b..7bbfc48cb 100644 --- a/test/moment/create.js +++ b/test/moment/create.js @@ -261,6 +261,7 @@ exports.create = { ['HH:mm:ss SSS', '00:30:00 789'], ['X', '1234567890'], ['LT', '12:30 AM'], + ['LTS', '12:30:29 AM'], ['L', '09/02/1999'], ['l', '9/2/1999'], ['LL', 'September 2, 1999'],