swift3 - How to set the first date of current week to Wednesday in Swift? -


how set first date of week wednesday , show first , last date of week on yellow bar? because schedule update every wednesday.

app design screenshot

please check might :

var calendar = calendar.current calendar.firstweekday = 4  let startofweek = calendar.date(from: calendar.current.datecomponents([.yearforweekofyear, .weekofyear], from: date()))!     let endofweek = calendar.date(byadding: .day, value: 6, to: startofweek)!  print(startofweek) print(endofweek) 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -