mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added new improvements
This commit is contained in:
parent
d3b134586b
commit
a32b1f4615
@ -12,6 +12,9 @@ public class HourBattery extends Battery{
|
|||||||
}
|
}
|
||||||
public static double getHourProgress(TimeHM timeRemains, int secondsRemains,
|
public static double getHourProgress(TimeHM timeRemains, int secondsRemains,
|
||||||
int millisecondsRemains) {
|
int millisecondsRemains) {
|
||||||
|
if(secondsRemains < 0 || millisecondsRemains < 0 || timeRemains.getHour() < 0 || timeRemains.getMinute() < 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
double minutesRemainsD = timeRemains.getMinute();
|
double minutesRemainsD = timeRemains.getMinute();
|
||||||
double secondsRemainsD = secondsRemains;
|
double secondsRemainsD = secondsRemains;
|
||||||
double millisecondsRemainsD = millisecondsRemains;
|
double millisecondsRemainsD = millisecondsRemains;
|
||||||
|
@ -9,6 +9,9 @@ public class MonthBattery extends Battery{
|
|||||||
super("Month", x, i, i1);
|
super("Month", x, i, i1);
|
||||||
}
|
}
|
||||||
public static double getMonthProgress(int weekDayWhenMondayIsOne, int workDaysDone, int workDaysTotal, double done) {
|
public static double getMonthProgress(int weekDayWhenMondayIsOne, int workDaysDone, int workDaysTotal, double done) {
|
||||||
|
if(done >1) {
|
||||||
|
done = 1;
|
||||||
|
}
|
||||||
return weekDayWhenMondayIsOne == 0
|
return weekDayWhenMondayIsOne == 0
|
||||||
|| weekDayWhenMondayIsOne == 6 ?
|
|| weekDayWhenMondayIsOne == 6 ?
|
||||||
workDaysDone / workDaysTotal :
|
workDaysDone / workDaysTotal :
|
||||||
|
@ -11,6 +11,9 @@ public class WeekBattery extends Battery{
|
|||||||
super("Week", x, i, i1);
|
super("Week", x, i, i1);
|
||||||
}
|
}
|
||||||
public static double getWeekProgress(int weekDayWhenMondayIsOne, double done) {
|
public static double getWeekProgress(int weekDayWhenMondayIsOne, double done) {
|
||||||
|
if(done >1) {
|
||||||
|
done = 1;
|
||||||
|
}
|
||||||
return weekDayWhenMondayIsOne == 0
|
return weekDayWhenMondayIsOne == 0
|
||||||
|| weekDayWhenMondayIsOne == 6 ?
|
|| weekDayWhenMondayIsOne == 6 ?
|
||||||
100 : ((weekDayWhenMondayIsOne - 1) * 0.20 + done * 0.20);
|
100 : ((weekDayWhenMondayIsOne - 1) * 0.20 + done * 0.20);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user