Attempt to fix unpaid hours not displaying

This commit is contained in:
zontreck 2025-05-25 01:22:06 -07:00
parent ebfc4ddc05
commit 5c67ec76b2
3 changed files with 10 additions and 5 deletions

View file

@ -9,7 +9,7 @@ class TTConsts {
static get SESSION_SERVER =>
"https://api.zontreck.com/timetrack/$UPDATE_CHANNEL/timetrack.php";
static const VERSION = "1.0.0-beta.15";
static const VERSION = "1.0.0-beta.16";
static bool UPDATE_AVAILABLE = false;
static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta;

View file

@ -70,10 +70,15 @@ class SessionData {
static String GetUnpaidHours() {
// This is the inverted value of paid hours. We get total hours and subtract it from the paid hours. This gives us the unpaid hours.
Duration totalTime = EndTime.difference(StartTime);
Duration unpaid = _GetPaidHours() - totalTime;
Time totalHoursWorked = Time.fromNotation(GetPaidHours());
return Duration2Notation(unpaid);
Duration totalDuration = EndTime.difference(StartTime);
Time totalTime = Time.fromDuration(totalDuration);
Time unpaid = totalTime.copy();
unpaid.subtract(totalHoursWorked);
return unpaid.toString();
}
static String GetTotalMilesAsString() {

View file

@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0-beta.15
version: 1.0.0-beta.16
environment:
sdk: ^3.7.2