File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,8 @@ function timeZoneGetter(date) {
214214 var zone = - 1 * date . getTimezoneOffset ( ) ;
215215 var paddedZone = ( zone >= 0 ) ? "+" : "" ;
216216
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 ) ;
218219
219220 return paddedZone ;
220221}
Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ describe('filters', function() {
227227 var utc = new angular . mock . TzDate ( 0 , '2010-09-03T12:05:08.000Z' ) ;
228228 var eastOfUTC = new angular . mock . TzDate ( - 5 , '2010-09-03T12:05:08.000Z' ) ;
229229 var westOfUTC = new angular . mock . TzDate ( + 5 , '2010-09-03T12:05:08.000Z' ) ;
230+ var eastOfUTCPartial = new angular . mock . TzDate ( - 5.5 , '2010-09-03T12:05:08.000Z' ) ;
231+ var westOfUTCPartial = new angular . mock . TzDate ( + 5.5 , '2010-09-03T12:05:08.000Z' ) ;
230232
231233 expect ( date ( utc , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
232234 toEqual ( '2010-09-03T12:05:08+0000' )
@@ -236,6 +238,12 @@ describe('filters', function() {
236238
237239 expect ( date ( westOfUTC , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
238240 toEqual ( '2010-09-03T07:05:08-0500' )
241+
242+ expect ( date ( eastOfUTCPartial , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
243+ toEqual ( '2010-09-03T17:35:08+0530' )
244+
245+ expect ( date ( westOfUTCPartial , "yyyy-MM-ddTHH:mm:ssZ" ) ) .
246+ toEqual ( '2010-09-03T06:35:08-0530' )
239247 } ) ;
240248
241249 it ( 'should treat single quoted strings as string literals' , function ( ) {
You can’t perform that action at this time.
0 commit comments