Fix paid hours not properly displaying due to deserializing bug
This commit is contained in:
parent
791d606336
commit
5e70507c19
3 changed files with 18 additions and 5 deletions
|
@ -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.22";
|
||||
static const VERSION = "1.0.0-beta.23";
|
||||
|
||||
static bool UPDATE_AVAILABLE = false;
|
||||
static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta;
|
||||
|
|
|
@ -71,12 +71,23 @@ class SessionData {
|
|||
}
|
||||
|
||||
static Duration _GetPaidHours() {
|
||||
Duration stamp = Duration();
|
||||
Time stamp = Time(days: 0, hours: 0, minutes: 0, seconds: 0);
|
||||
print("Total trips: ${Trips.length}");
|
||||
for (var trip in Trips) {
|
||||
stamp += trip.EndTime.difference(trip.StartTime);
|
||||
var diff = trip.EndTime.difference(trip.StartTime);
|
||||
var diffTime = Time(
|
||||
days: 0,
|
||||
hours: 0,
|
||||
minutes: 0,
|
||||
seconds: diff.inSeconds,
|
||||
);
|
||||
stamp.add(diffTime);
|
||||
print("Add timestamp; ${diff}; ${diffTime}");
|
||||
}
|
||||
|
||||
return stamp;
|
||||
print("Final time: ${stamp}");
|
||||
|
||||
return stamp.toDuration();
|
||||
}
|
||||
|
||||
static String GetUnpaidHours() {
|
||||
|
@ -699,6 +710,8 @@ class Trip {
|
|||
trip.StartTime = DateTime.parse(tag.get("start")!.asString());
|
||||
if (!tag.containsKey("end")) {
|
||||
SessionData.ContainsTripTimes = false;
|
||||
} else {
|
||||
trip.EndTime = DateTime.parse(tag.get("end")!.asString());
|
||||
}
|
||||
|
||||
ListTag drops = tag.get("deliveries")! as ListTag;
|
||||
|
|
|
@ -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.22
|
||||
version: 1.0.0-beta.23
|
||||
|
||||
environment:
|
||||
sdk: ^3.7.2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue