Permalink
Browse files

Fix age warnings for events not in the current year

  • Loading branch information...
andreas-gruenbacher committed Nov 13, 2017
1 parent e315ba1 commit 9334b0fdf44ab17079b5f7ea031764ff94c86bad
Showing with 4 additions and 2 deletions.
  1. +2 −1 htdocs/admin/riders/controller.js
  2. +2 −1 htdocs/register/event/controller.js
@@ -241,8 +241,9 @@ var ridersController = [
$scope.age_year = age_year.getFullYear() - 1970 - 1;
});
var year_of_event = (date_of_event(event) || new Date()).getFullYear();
$scope.year_for_age = function(age) {
return new Date().getFullYear() - age - 1;
return year_of_event - age - 1;
}
function update_numbers(old_number, new_number) {
@@ -158,8 +158,9 @@ var eventController = [
otsv_check_class();
});
var year_of_event = (date_of_event(event) || new Date()).getFullYear();
$scope.year_for_age = function(age) {
return new Date().getFullYear() - age - 1;
return year_of_event - age - 1;
}
$scope.$watch('rider.class', function(class_) {

0 comments on commit 9334b0f

Please sign in to comment.