Skip to content

Commit

Permalink
Fix months and years calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi Chamouma authored and Mehdi Chamouma committed May 17, 2014
1 parent 47a2daf commit d925633
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ angular.module('timer', [])
$scope.minutes = Math.floor((($scope.millis / (60000)) % 60));
$scope.hours = Math.floor((($scope.millis / (3600000)) % 24));
$scope.days = Math.floor((($scope.millis / (3600000)) / 24) % 30);
$scope.months = Math.floor(($scope.millis / (3600000)) / 24 / 30);
$scope.years = Math.floor(($scope.millis / (3600000)) / 24 / 30 / 12);
$scope.months = Math.floor((($scope.millis / (3600000)) / 24 / 30) % 12);
$scope.years = Math.floor(($scope.millis / (3600000)) / 24 / 365);
}

// plural - singular unit decision
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-timer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* angular-timer - v1.1.1 - 2014-05-17 3:24 AM
* angular-timer - v1.1.1 - 2014-05-17 3:54 AM
* https://github.com/siddii/angular-timer
*
* Copyright (c) 2014 Siddique Hameed
Expand Down Expand Up @@ -154,8 +154,8 @@ angular.module('timer', [])
$scope.minutes = Math.floor((($scope.millis / (60000)) % 60));
$scope.hours = Math.floor((($scope.millis / (3600000)) % 24));
$scope.days = Math.floor((($scope.millis / (3600000)) / 24) % 30);
$scope.months = Math.floor(($scope.millis / (3600000)) / 24 / 30);
$scope.years = Math.floor(($scope.millis / (3600000)) / 24 / 30 / 12);
$scope.months = Math.floor((($scope.millis / (3600000)) / 24 / 30) % 12);
$scope.years = Math.floor(($scope.millis / (3600000)) / 24 / 365);
}

// plural - singular unit decision
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 d925633

Please sign in to comment.