11/**
2- * angular-timer - v1.0.12 - 2014-03-18 4:02 PM
2+ * angular-timer - v1.0.12 - 2014-04-13 4:22 PM
33 * https://github.com/siddii/angular-timer
44 *
55 * Copyright (c) 2014 Siddique Hameed
@@ -19,6 +19,14 @@ angular.module('timer', [])
1919 } ,
2020 controller : [ '$scope' , '$element' , '$attrs' , '$timeout' , function ( $scope , $element , $attrs , $timeout ) {
2121
22+ // Checking for trim function since IE8 doesn't have it
23+ // If not a function, create tirm with RegEx to mimic native trim
24+ if ( typeof String . prototype . trim !== 'function' ) {
25+ String . prototype . trim = function ( ) {
26+ return this . replace ( / ^ \s + | \s + $ / g, '' ) ;
27+ } ;
28+ }
29+
2230 //angular 1.2 doesn't support attributes ending in "-start", so we're
2331 //supporting both "autostart" and "auto-start" as a solution for
2432 //backward and forward compatibility.
@@ -112,14 +120,12 @@ angular.module('timer', [])
112120 $scope . days = Math . floor ( ( ( $scope . millis / ( 3600000 ) ) / 24 ) ) ;
113121 $scope . daysS = $scope . days == 1 ? '' : 's' ;
114122
115-
116123 //add leading zero if number is smaller than 10
117124 $scope . sseconds = $scope . seconds < 10 ? '0' + $scope . seconds : $scope . seconds ;
118125 $scope . mminutes = $scope . minutes < 10 ? '0' + $scope . minutes : $scope . minutes ;
119126 $scope . hhours = $scope . hours < 10 ? '0' + $scope . hours : $scope . hours ;
120127 $scope . ddays = $scope . days < 10 ? '0' + $scope . days : $scope . days ;
121128
122-
123129 }
124130 //determine initial values of time units and add AddSeconds functionality
125131 if ( $scope . countdownattr ) {
0 commit comments