From 1d0c89ead1dc18ade2051e80b194b9de290106d5 Mon Sep 17 00:00:00 2001 From: dam Date: Fri, 21 Apr 2023 00:04:51 +0100 Subject: Fixed bugs on update_times. --- ttt.jai | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ttt.jai') 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. -- cgit v1.2.3