Browse Source

Fixes #75

Yes, NaN in new year was the culprit.
devel
Jonathan Rosenbaum 6 years ago
parent
commit
b8a42f11a0
  1. 11
      js/transaction.js

11
js/transaction.js

@ -1567,8 +1567,15 @@ $(function() {
} else {
if ($("#redeemable_hours").val().length) {
volunteer_benefits_history[year].volunteer_hours_redeemed = parseFloat(volunteer_benefits_history[year].volunteer_hours_redeemed) +
parseFloat($("#redeemable_hours").val());
// NaN bug #75
if (volunteer_benefits_history[year].volunteer_hours_redeemed === "NaN") {
vhr = 0;
} else {
vhr = parseFloat(volunteer_benefits_history[year].volunteer_hours_redeemed);
}
volunteer_benefits_history[year].volunteer_hours_redeemed = vhr + parseFloat($("#redeemable_hours").val());
if (parseFloat(volunteer_benefits_history[year].max_bike_earned) < maximum_allowable_earned_bikes) {
volunteer_benefits_history[year].max_bike_earned = parseFloat(volunteer_benefits_history[year].max_bike_earned) +

Loading…
Cancel
Save