angular-timer
angular-timer copied to clipboard
A month doesn't last 30 days
Hello,
When using the timer to display an age, there's a spectacular difference between the displayed month value and the real one.
It's due to the fact that the library consider that a month last 30 days.
https://github.com/siddii/angular-timer/blob/master/app/js/_timer.js#L218
I believe there are other ways to compute it, or if we want to stay approximative, please use 30.4375 :)
Maybe something like this :
$scope.months = Math.floor((($scope.millis / (3600000)) / 24 / 30.4375) % 12);
$scope.years = Math.floor(($scope.millis / (3600000)) / 24 / 365.25);
$scope.days = Math.floor((($scope.millis / (3600000)) / 24 - $scope.years * 365.25 - $scope.months*30.4375));
Thanks for the project anyway :)