We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to format the view header day and date in the Flutter Calendar

In the Flutter Event Calendar, you can format the view header date and day by using the dayFormat and dateFormat properties in TimeSlotViewSettings.

Inside the state initialize the default values for calendar.

final CalendarController _controller = CalendarController();
String _dayFormat = 'EEE', _dateFormat = 'dd';
CalendarDataSource? _dataSource;
initState() {
  _dataSource = _getCalendarDataSource();

Using onViewChanged callback get the current calendar view, based on the calendar views, set the dayFormat and dateFormat.

void viewChanged(ViewChangedDetails viewChangedDetails) {
  if (_controller.view == CalendarView.day) {
    SchedulerBinding.instance!.addPostFrameCallback((Duration duration) {
      if (_dayFormat != 'EEEEE' || _dateFormat != 'dd') {
        setState(() {
          _dayFormat = 'EEEEE';
          _dateFormat = 'dd';
      } else {
  } else {
    SchedulerBinding.instance!.addPostFrameCallback((Duration duration) {
      if (_dayFormat != 'EEE' || _dateFormat != 'dd') {
        setState(() {
          _dayFormat = 'EEE';
          _dateFormat = 'dd';
      } else {

Assign _dayFormat and _dateFormat values to the calendar.

child: SfCalendar(
  view: CalendarView.week,
  allowedViews: [
  controller: _controller,
  dataSource: _dataSource,
  timeSlotViewSettings: TimeSlotViewSettings(
      dateFormat: _dateFormat, dayFormat: _dayFormat),
  onViewChanged: viewChanged,

View sample in GitHub

              Day view

day view



             Week view

week view


           Work week view

work week view



You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile