File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ angular.module("datetime").factory("datetime", function($locale){
2
2
// Fetch date and time formats from $locale service
3
3
var formats = $locale . DATETIME_FORMATS ;
4
4
// Valid format tokens. 1=sss, 2=''
5
- var tokenRE = / y y y y | y y | y | M { 1 , 4 } | d d ? | E E E E ? | H H ? | h h ? | m m ? | s s ? | ( [ . , ] ) s s s | a | Z | w w | w | ' ( ( [ ^ ' ] + | ' ' ) * ) ' / g;
5
+ var tokenRE = / y y y y | y y | y | M { 1 , 4 } | d d ? | E E E E ? | H H ? | h h ? | m m ? | s s ? | ( [ . , ] ) s s s | a | Z { 1 , 2 } | w w | w | ' ( ( [ ^ ' ] + | ' ' ) * ) ' / g;
6
6
// Token definition
7
7
var definedTokens = {
8
8
"y" : {
@@ -184,6 +184,11 @@ angular.module("datetime").factory("datetime", function($locale){
184
184
type : "regex" ,
185
185
regex : / [ + - ] \d { 4 } /
186
186
} ,
187
+ "ZZ" : {
188
+ name : "timezoneWithColon" ,
189
+ type : "regex" ,
190
+ regex : / [ + - ] \d { 2 } : \d { 2 } /
191
+ } ,
187
192
"string" : {
188
193
name : "string" ,
189
194
type : "static"
@@ -339,6 +344,9 @@ angular.module("datetime").factory("datetime", function($locale){
339
344
case "timezone" :
340
345
node . value = ( date . getTimezoneOffset ( ) > 0 ? "-" : "+" ) + num2str ( Math . abs ( date . getTimezoneOffset ( ) / 60 ) , 2 , 2 ) + "00" ;
341
346
break ;
347
+ case "timezoneWithColon" :
348
+ node . value = ( date . getTimezoneOffset ( ) > 0 ? "-" : "+" ) + num2str ( Math . abs ( date . getTimezoneOffset ( ) / 60 ) , 2 , 2 ) + ":00" ;
349
+ break ;
342
350
}
343
351
344
352
if ( node . value < 0 ) {
You can’t perform that action at this time.
0 commit comments