nonWorkingDays property
The non working days for the work week view and time slot work week view in SfCalendar.
Defaults to <int>[DateTime.saturday, DateTime.sunday]
.
Note: This is only applicable only when the calendar view set as CalendarView.workWeek or CalendarView.timelineWorkWeek view.
See also:
- startHour, which is the start hour for the timeslot views of the calendar.
- endHour, which is the end hour for the timeslot view of the calendar.
- TimeRegion, which is used to customize the specific time region in the timeslot views of the calendar.
- Knowledge base: How to change working days and hours
- Knowledge base: How to highlight working and non working hours
- Knowledge base: How to highlight the weekends
Widget build(BuildContext context) {
return Container(
child: SfCalendar(
view: CalendarView.workWeek,
timeSlotViewSettings: TimeSlotViewSettings(
startHour: 10,
endHour: 20,
nonWorkingDays: <int>[
DateTime.saturday,
DateTime.sunday,
DateTime.friday
],
timeInterval: Duration(minutes: 120),
timeIntervalHeight: 80,
timeFormat: 'h:mm',
dateFormat: 'd',
dayFormat: 'EEE',
timeRulerSize: 70),
),
);
}
Implementation
final List<int> nonWorkingDays;