I am using JTCalender
in project.I want to change the order of days displayed.The weekdays starts from Monday
and end into Sunday
.But i want the weekday from Sunday
and end into Monday
.Please guide me how can i implement.I am not able to understand how to change it.
Asked
Active
Viewed 1,127 times
2

TechChain
- 8,404
- 29
- 103
- 228
1 Answers
4
You can set the firstDayOfWeek to whichever day you want while configuring the the JTAppleCalendar using the JTAppleCalendarViewDataSource Method:-
func configureCalendar(_ calendar: JTAppleCalendarView) -> ConfigurationParameters {
let startDate = formatter.date(from: "2016 03 01")!
let endDate = formatter.date(from: "2020 12 01")!
var generateInDates: InDateCellGeneration = .forAllMonths
var generateOutDates: OutDateCellGeneration = .tillEndOfGrid
let firstDayOfWeek: DaysOfWeek = .sunday
var numberOfRows = 6
var testCalendar = Calendar.current
let parameters = ConfigurationParameters(startDate: startDate,
endDate: endDate,
numberOfRows: numberOfRows,
calendar: testCalendar,
generateInDates: generateInDates,
generateOutDates: generateOutDates,
firstDayOfWeek: firstDayOfWeek)
return parameters
}
For JTCalendar, you can set the first day of the week using,
[_calendarManager.dateHelper.calendar setFirstWeekday:2]
replace "2" with whichever day you want.

Aakash
- 2,239
- 15
- 23
-
I don't have this file in my code JTAppleCalendarViewDataSource – TechChain Dec 05 '16 at 06:53
-
Which version of JTAppleCalendar are you using? – Aakash Dec 05 '16 at 06:57
-
Latest from the github – TechChain Dec 05 '16 at 07:04
-
Are you using JTAppleCalendar or JTCalendar? – Aakash Dec 05 '16 at 07:05
-
if you using JTCalendar: [_calendarManager.dateHelper.calendar setFirstWeekday:2] – Aakash Dec 05 '16 at 07:10
-
likewise you can set whichever day of the week you want to start with, I am gonna add this to my answer too! – Aakash Dec 05 '16 at 07:11