fixed fetchplantimes
parent
bfd6f04c63
commit
e7db977a63
|
|
@ -87,10 +87,10 @@ public class PlanTimes {
|
|||
var minutes = change.get(queryChanges.getFieldId("PlanTimeMinutes")).toString();
|
||||
var hours = change.get(queryChanges.getFieldId("PlanTimeHours")).toString();
|
||||
double plantime = convertPlanTime(hours, minutes);
|
||||
System.out.println(plantime);
|
||||
planTimePerWeek += plantime;
|
||||
}
|
||||
}
|
||||
System.out.println(planTimePerWeek);
|
||||
week.setPlanTime((int) Math.ceil(planTimePerWeek));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
@ -110,13 +110,16 @@ public class PlanTimes {
|
|||
public double convertPlanTime(String hours, String minutes) throws ARException {
|
||||
double mins = 0.0;
|
||||
double hrs = 0.0;
|
||||
if (minutes != null)
|
||||
mins = (Double.valueOf(minutes) / 60.0);
|
||||
if (hours != null)
|
||||
Double.valueOf(hours);
|
||||
if (minutes != null) {
|
||||
mins = (Double.valueOf(minutes) / 60.0); // Convert minutes to hours
|
||||
}
|
||||
if (hours != null) {
|
||||
hrs = Double.valueOf(hours); // Correctly assign the value to hrs
|
||||
}
|
||||
double totalHours = hrs + mins;
|
||||
return totalHours;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts a timestamp string to a LocalDate object.
|
||||
|
|
|
|||
Loading…
Reference in New Issue