You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.offset(.day, value: d) does not work for all days of the week #127
var weekdays: [Date] {
var days = Date
let sunday = Date.now.adjust(for: .startOfWeek)!
for d in 0...6 {
let day = sunday.offset(.day, value: d)!
days.append(day)
}
return days
}
Results in:
Sun - 6/2/24, 12:00 AM
Mon - 6/3/24, 12:00 AM
Tue - 6/4/24, 12:00 AM
Wed - 6/5/24, 12:00 AM
Tue - 6/4/24, 12:00 AM
Fri - 6/7/24, 12:00 AM
Sun - 6/2/24, 12:00 AM
Activity
vince-marco commentedon Jun 8, 2024
This is possibly an issue with Apple's Date class, as it produces the same results with .addingTimeInterval(606024).