1
1
/**
2
- * angular-timer - v1.0.12 - 2014-03-18 4:02 PM
2
+ * angular-timer - v1.0.12 - 2014-04-13 4:22 PM
3
3
* https://github.com/siddii/angular-timer
4
4
*
5
5
* Copyright (c) 2014 Siddique Hameed
@@ -19,6 +19,14 @@ angular.module('timer', [])
19
19
} ,
20
20
controller : [ '$scope' , '$element' , '$attrs' , '$timeout' , function ( $scope , $element , $attrs , $timeout ) {
21
21
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
+
22
30
//angular 1.2 doesn't support attributes ending in "-start", so we're
23
31
//supporting both "autostart" and "auto-start" as a solution for
24
32
//backward and forward compatibility.
@@ -112,14 +120,12 @@ angular.module('timer', [])
112
120
$scope . days = Math . floor ( ( ( $scope . millis / ( 3600000 ) ) / 24 ) ) ;
113
121
$scope . daysS = $scope . days == 1 ? '' : 's' ;
114
122
115
-
116
123
//add leading zero if number is smaller than 10
117
124
$scope . sseconds = $scope . seconds < 10 ? '0' + $scope . seconds : $scope . seconds ;
118
125
$scope . mminutes = $scope . minutes < 10 ? '0' + $scope . minutes : $scope . minutes ;
119
126
$scope . hhours = $scope . hours < 10 ? '0' + $scope . hours : $scope . hours ;
120
127
$scope . ddays = $scope . days < 10 ? '0' + $scope . days : $scope . days ;
121
128
122
-
123
129
}
124
130
//determine initial values of time units and add AddSeconds functionality
125
131
if ( $scope . countdownattr ) {
0 commit comments