This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,8 @@ function timeZoneGetter(date) {
214
214
var zone = - 1 * date . getTimezoneOffset ( ) ;
215
215
var paddedZone = ( zone >= 0 ) ? "+" : "" ;
216
216
217
- paddedZone += padNumber ( zone / 60 , 2 ) + padNumber ( Math . abs ( zone % 60 ) , 2 ) ;
217
+ paddedZone += padNumber ( Math [ zone > 0 ? 'floor' : 'ceil' ] ( zone / 60 ) , 2 ) +
218
+ padNumber ( Math . abs ( zone % 60 ) , 2 ) ;
218
219
219
220
return paddedZone ;
220
221
}
Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ describe('filters', function() {
236
236
var utc = new angular . mock . TzDate ( 0 , '2010-09-03T12:05:08.000Z' ) ;
237
237
var eastOfUTC = new angular . mock . TzDate ( - 5 , '2010-09-03T12:05:08.000Z' ) ;
238
238
var westOfUTC = new angular . mock . TzDate ( + 5 , '2010-09-03T12:05:08.000Z' ) ;
239
+ var eastOfUTCPartial = new angular . mock . TzDate ( - 5.5 , '2010-09-03T12:05:08.000Z' ) ;
240
+ var westOfUTCPartial = new angular . mock . TzDate ( + 5.5 , '2010-09-03T12:05:08.000Z' ) ;
239
241
240
242
expect ( date ( utc , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
241
243
toEqual ( '2010-09-03T12:05:08+0000' )
@@ -245,6 +247,12 @@ describe('filters', function() {
245
247
246
248
expect ( date ( westOfUTC , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
247
249
toEqual ( '2010-09-03T07:05:08-0500' )
250
+
251
+ expect ( date ( eastOfUTCPartial , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
252
+ toEqual ( '2010-09-03T17:35:08+0530' )
253
+
254
+ expect ( date ( westOfUTCPartial , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
255
+ toEqual ( '2010-09-03T06:35:08-0530' )
248
256
} ) ;
249
257
250
258
it ( 'should treat single quoted strings as string literals' , function ( ) {
You can’t perform that action at this time.
0 commit comments