Skip to content

Commit

Permalink
Merge pull request siddii#63 from siddii/cworsley4-master
Browse files Browse the repository at this point in the history
  • Loading branch information
siddii committed Apr 14, 2014
2 parents 0711c00 + cebaecc commit 85385af
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
8 changes: 8 additions & 0 deletions app/js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ angular.module('timer', [])
},
controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {

// Checking for trim function since IE8 doesn't have it
// If not a function, create tirm with RegEx to mimic native trim
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};
}

//angular 1.2 doesn't support attributes ending in "-start", so we're
//supporting both "autostart" and "auto-start" as a solution for
//backward and forward compatibility.
Expand Down
12 changes: 9 additions & 3 deletions dist/angular-timer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* angular-timer - v1.0.12 - 2014-03-18 4:02 PM
* angular-timer - v1.0.12 - 2014-04-13 4:22 PM
* https://github.com/siddii/angular-timer
*
* Copyright (c) 2014 Siddique Hameed
Expand All @@ -19,6 +19,14 @@ angular.module('timer', [])
},
controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {

// Checking for trim function since IE8 doesn't have it
// If not a function, create tirm with RegEx to mimic native trim
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};
}

//angular 1.2 doesn't support attributes ending in "-start", so we're
//supporting both "autostart" and "auto-start" as a solution for
//backward and forward compatibility.
Expand Down Expand Up @@ -112,14 +120,12 @@ angular.module('timer', [])
$scope.days = Math.floor((($scope.millis / (3600000)) / 24));
$scope.daysS = $scope.days==1 ? '' : 's';


//add leading zero if number is smaller than 10
$scope.sseconds = $scope.seconds < 10 ? '0' + $scope.seconds : $scope.seconds;
$scope.mminutes = $scope.minutes < 10 ? '0' + $scope.minutes : $scope.minutes;
$scope.hhours = $scope.hours < 10 ? '0' + $scope.hours : $scope.hours;
$scope.ddays = $scope.days < 10 ? '0' + $scope.days : $scope.days;


}
//determine initial values of time units and add AddSeconds functionality
if ($scope.countdownattr) {
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-timer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85385af

Please sign in to comment.