Skip to content

Commit

Permalink
Fix GregorianDay.startOfMonth implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Mar 26, 2024
1 parent 1ea761e commit 970dad7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/HandySwift/Types/GregorianDay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public struct GregorianDay {
/// ```
public func startOfNextMonth(timeZone: TimeZone = .current) -> Date {
guard self.month < 12 else { return self.startOfNextYear() }
return self.with { $0.month += 1 }.startOfDay()
return self.with { $0.month += 1; $0.day = 1 }.startOfDay()
}

/// Returns the start of the next year from the date.
Expand Down

0 comments on commit 970dad7

Please sign in to comment.