@@ -201,6 +201,9 @@ namespace('Date', function () {
201
201
assertDateParsed ( 'this week tuesday at 5pm' , { future : true } , testGetWeekday ( 2 , 0 , 17 ) ) ;
202
202
assertDateParsed ( 'today at 5pm' , { future : true } , new Date ( now . getFullYear ( ) , now . getMonth ( ) , now . getDate ( ) , 17 ) ) ;
203
203
204
+ // Issue #582 "now" with "fromUTC"
205
+ assertDateParsed ( 'now' , { fromUTC : true } , new Date ( ) , 'now with fromUTC' ) ;
206
+
204
207
} ) ;
205
208
206
209
group ( 'Create | Simple' , function ( ) {
@@ -1917,7 +1920,7 @@ namespace('Date', function () {
1917
1920
raisesError ( function ( ) { run ( d , 'format' , [ '{foo}' ] ) ; } , 'unknown ldml token raises error' , TypeError ) ;
1918
1921
1919
1922
// Not all environments provide that so just make sure it returns the abbreviation or nothing.
1920
- equal ( / \ w{ 3 } | ^ $ / . test ( run ( d , 'format' , [ '{z}' ] ) ) , true , 'Timezone abbreviation' ) ;
1923
+ equal ( / [ - + ] \d { 2 , 4 } | \ w{ 3 , 5 } | ^ $ / . test ( run ( d , 'format' , [ '{z}' ] ) ) , true , 'Timezone abbreviation' ) ;
1921
1924
1922
1925
test ( new Date ( 'January 4, 2010' ) , [ '{D}' ] , '4' , 'Day of the year' ) ;
1923
1926
test ( new Date ( 'January 4, 2010' ) , [ '{DDD}' ] , '004' , 'Day of the year padded' ) ;
@@ -2065,7 +2068,8 @@ namespace('Date', function () {
2065
2068
raisesError ( function ( ) { run ( d , 'format' , [ '%foo' ] ) ; } , 'unknown strf token raises error' , TypeError ) ;
2066
2069
2067
2070
equal ( / [ + - ] \d { 4 } / . test ( run ( d , 'format' , [ '%z' ] ) ) , true , 'Timezone offset' ) ;
2068
- equal ( / \w { 3 } / . test ( run ( d , 'format' , [ '%Z' ] ) ) , true , 'Timezone abbreviation' ) ;
2071
+ equal ( / [ - + ] \d { 2 , 4 } | \w { 3 , 5 } | ^ $ / . test ( run ( d , 'format' , [ '%Z' ] ) ) , true , 'Timezone abbreviation' ) ;
2072
+ equal ( / [ - + ] \d { 2 , 4 } | \w { 3 , 5 } | ^ $ / . test ( run ( d , 'format' , [ '{z}' ] ) ) , true , 'Timezone abbreviation' ) ;
2069
2073
2070
2074
test ( new Date ( 'January 1, 2010' ) , [ '%c' , 'en-GB' ] , 'Fri 1 Jan 2010 0:00' , 'Preferred stamp | UK' ) ;
2071
2075
0 commit comments