aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordam <dam@gudinoff>2023-04-21 00:04:51 +0100
committerdam <dam@gudinoff>2023-04-21 00:04:51 +0100
commit1d0c89ead1dc18ade2051e80b194b9de290106d5 (patch)
treeecf96ebb7bc87d3f84c0d5ebb392b76ee5fb1d21
parent804dd0a008b9e3ecaecae217cbbd18c7d6d5a502 (diff)
downloadtask-time-tracker-1d0c89ead1dc18ade2051e80b194b9de290106d5.tar.zst
task-time-tracker-1d0c89ead1dc18ade2051e80b194b9de290106d5.zip
Fixed bugs on update_times.
-rw-r--r--ttt.jai12
1 files changed, 6 insertions, 6 deletions
diff --git a/ttt.jai b/ttt.jai
index b2639d9..9c7f948 100644
--- a/ttt.jai
+++ b/ttt.jai
@@ -434,11 +434,14 @@ move_task :: (db: *Database, source: s64, target: s64) { // TODO Maybe `using db
update_times :: (db: *Database) {
assert(db != null, ASSERT_NOT_NULL, "db");
- if db.active_idx < 0 return;
-
// Get time frame in UTC.
start_time := db.modified_on;
- stop_time := current_time_consensus();
+ stop_time := seconds_to_apollo(to_seconds(current_time_consensus())); // HACK Discard sub-seconds information because Task.times only store seconds. To other workaround would be to use Task.times as Apollo_Time instead of s64 seconds.
+
+ // Keep track of this update.
+ db.modified_on = stop_time;
+
+ if db.active_idx < 0 return;
active_task := *db.tasks[db.active_idx];
start_week_day: s8;
@@ -462,9 +465,6 @@ update_times :: (db: *Database) {
start_time = next_start;
}
-
- // Keep track of this update.
- db.modified_on = stop_time;
}
// Recalculates database totals.