From 5f3c5a4c12ea8f766248eb3e68ceab623384ca0f Mon Sep 17 00:00:00 2001 From: krugerk <4656811+krugerk@users.noreply.github.com> Date: Sat, 23 Nov 2024 10:58:24 +0100 Subject: [PATCH] initial date in add datapoint looks wrong Given the scenario, now is 1AM and one is entering into GoalVC for a goal with a deadline of 3AM the initial date shown was tomorrow. Expected might have been today and better yet is probably yesterday since 1AM is before the 3AM deadline, thus the daystamp for a datapoint added _now_ is still the (calendar) day before. --- BeeSwift/GoalViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BeeSwift/GoalViewController.swift b/BeeSwift/GoalViewController.swift index 47e63051..0b3e214d 100644 --- a/BeeSwift/GoalViewController.swift +++ b/BeeSwift/GoalViewController.swift @@ -502,7 +502,7 @@ class GoalViewController: UIViewController, UIScrollViewDelegate, DatapointTabl let daystampAssumingMidnightDeadline = Daystamp(fromDate: date, deadline: 0) - return Double(daystampAccountingForTheGoalsDeadline.distance(to: daystampAssumingMidnightDeadline)) + return Double(daystampAssumingMidnightDeadline.distance(to: daystampAccountingForTheGoalsDeadline)) } // MARK: - SFSafariViewControllerDelegate