Javascript
Hej AlleHvad går der galt i nedenstående beregner?
JEg kan ikke få den til at beregne på "blue", uanset hvad jeg prøver får jeg kun beregning på "green".
Input fungerer fint, altså dag, hr og min.
Håber der er et klogt hovede der kan gennemskue fejlen?
var blue_flag_fall = 500.0000;
var blue_distance_rate = 50.000;
var green_flag_fall = 600.0000;
var green_distance_rate = 60.0000;
________________________________________________
var blue_start_day = 1;
var blue_end_day = 4;
var blue_start_hr = 7;
var blue_start_min = 0;
var blue_end_hr = 15;
var blue_end_min = 59;
var green_start_day = 1;
var green_end_day = 5;
var green_start_hr = 16;
var green_start_min = 0;
var green_end_hr = 6;
var green_end_min = 59;
________________________________________________
total = blue_flag_fall + ((__distance / 1000) * blue_distance_rate);
} else if ((the_day >= blue_start_day && the_day <= blue_end_day) &&
(the_hr >= blue_start_hr && the_min >= blue_start_min) && (the_hr <= blue_end_hr && the_min <= blue_end_min)) {
total = blue_flag_fall + ((__distance / 1000) * blue_distance_rate);
total = green_flag_fall + ((__distance / 1000) * green_distance_rate);
} else if ((the_day >= green_start_day && the_day <= green_end_day) &&
(the_hr >= green_start_hr && the_min >= green_start_min) && (the_hr <= green_end_hr && the_min <= green_end_min)) {
total = green_flag_fall + ((__distance / 1000) * green_distance_rate);