Skip to content

Commit 93e9d37

Browse files
authored
Reduce parameter surface of makeUrtextDaystamp (#738)
## Summary makeUrtextDaystamp does not need all of Goal, just its deadline
1 parent 66f59be commit 93e9d37

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

BeeKit/Daystamp.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ public struct Daystamp: CustomStringConvertible, Strideable, Comparable, Equatab
144144
/// generates the daystamp as a string for use in urtext, considering both the submission date and goal's deadline
145145
/// - Parameters:
146146
/// - submissionDate: calendar date on which the datapoint would be submitted
147-
/// - goal: the goal for which the urtext is to be created
147+
/// - deadline: the goal's deadline
148148
/// - Returns: string of the daystamp, suitable for use in urtext
149-
public static func makeUrtextDaystamp(submissionDate: Date = Date(), goal: Goal) -> String {
150-
let daystamp = Daystamp(fromDate: submissionDate, deadline: goal.deadline)
149+
public static func makeUrtextDaystamp(submissionDate: Date = Date(), deadline: Int) -> String {
150+
let daystamp = Daystamp(fromDate: submissionDate, deadline: deadline)
151151
return String(format: "%04d %02d %02d", daystamp.year, daystamp.month, daystamp.day)
152152
}
153153
}

BeeSwift/GoalView/TimerViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class TimerViewController: UIViewController {
131131
self.updateTimerLabel()
132132
}
133133
func urtext() -> String {
134-
let urtextDaystamp = Daystamp.makeUrtextDaystamp(submissionDate: Date(), goal: goal)
134+
let urtextDaystamp = Daystamp.makeUrtextDaystamp(submissionDate: Date(), deadline: goal.deadline)
135135
let value: Double
136136

137137
switch self.units {

0 commit comments

Comments
 (0)