From 970dad7abe465642bd31f4d91dd7cdb8cf9456cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20G=C3=BCnd=C3=BCz?= Date: Tue, 26 Mar 2024 03:18:03 +0100 Subject: [PATCH] Fix GregorianDay.startOfMonth implementation --- Sources/HandySwift/Types/GregorianDay.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/HandySwift/Types/GregorianDay.swift b/Sources/HandySwift/Types/GregorianDay.swift index 3b9b93c..97591dc 100644 --- a/Sources/HandySwift/Types/GregorianDay.swift +++ b/Sources/HandySwift/Types/GregorianDay.swift @@ -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.