我必须实现图表,以便在传递日期对象和周数时需要获取周开始日期和周末日期。我怎样才能实现我尝试过但没有完全理解的东西?下面是我的代码:-工作日:-//DayofweekfuncgetDayOfWeek(today:String)->Int?{letformatter=DateFormatter()formatter.dateFormat="yyyy-MM-dd"iflettodayDate=formatter.date(from:today){letmyCalendar=NSCalendar(calendarIdentifier:NSCalendar.Identifier.gregori