endTimeZone property
The end time zone for an Appointment in SfCalendar.
If it is not null
the appointment end time will be calculated based on
the time zone set to this property and SfCalendar.timeZone property.
Defaults to null.
Note:_ If the startTimeZone and endTimeZone set as different time zone's and it's value falls invalid, the appointment will render with half an hour duration from the start time of the appointment.
See also:
- CalendarDataSource.getEndTimeZone, which maps the custom business objects corresponding property to this property.
- endTime, the date time value in which the appointment will end.
- endTimeZone, the timezone for the end time, the appointment will render by converting the end time based on the endTimeZone, and SfCalendar.timeZone.
- SfCalendar.timeZone, to set the timezone for the calendar.
- The documentation for time zone
Widget build(BuildContext context) {
return Container(
child: SfCalendar(
view: CalendarView.day,
dataSource: _getCalendarDataSource(),
),
);
}
class DataSource extends CalendarDataSource {
DataSource(List<Appointment> source) {
appointments = source;
}
}
DataSource _getCalendarDataSource() {
List<Appointment> appointments = <Appointment>[];
appointments.add(
Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(
Duration(hours: 2)),
isAllDay: true,
subject: 'Meeting',
color: Colors.blue,
startTimeZone: '',
endTimeZone: ''
));
return DataSource(appointments);
}
Implementation
String? endTimeZone;