Skip to content

[syncfusion_flutter_datepicker] can I custom header text format? #2495

@hakama99

Description

@hakama99

Use case

_getMonthHeaderText

final String monthTextFormat =
        monthFormat == null || monthFormat.isEmpty
            ? enableMultiView &&
                    navigationDirection ==
                        DateRangePickerNavigationDirection.vertical
                ? 'MMM'
                : 'MMMM'
            : monthFormat;
    String text;
    dynamic middleDate = dates[middleIndex];
    if (isHijri) {
      text =
          // ignore: lines_longer_than_80_chars
          '${DateRangePickerHelper.getHijriMonthText(middleDate, localizations, monthTextFormat)} ${middleDate.year}';
    } else {
      text =
          '${DateFormat(monthTextFormat, locale.toString()).format(middleDate)}'
          ' ${middleDate.year}';
    }

Proposal

I need format like this
'${middleDate.year} ${DateRangePickerHelper.getHijriMonthText(middleDate, localizations, monthTextFormat)}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions