How to set the first date of the week to Wednesday and show the first and last date of week on yellow bar? Because the schedule will update every Wednesday.
Please check this might help :
var calendar = Calendar.current
calendar.firstWeekday = 4
let startOfWeek = calendar.date(from: calendar.dateComponents([.yearForWeekOfYear, .weekOfYear], from: Date()))!
let endOfWeek = calendar.date(byAdding: .day, value: 6, to: startOfWeek)!
print(startOfWeek)
print(endOfWeek)