syncfusion / flutter-examples

This repository contains the Syncfusion Flutter UI widgets examples and the guide to use them.
Other
1.98k stars 775 forks source link

Custom day format #771

Closed mszakacz closed 10 months ago

mszakacz commented 1 year ago

Hello, It will be nice to custom a day format in month view. For example in polish language the default names (shortcuts) of the weekdays are: ['PON.', 'WT.', 'ŚR.', 'CZW.', 'PT.', 'SOB.', 'NIEDZ.'] as you see the name of the last day (which is Sunday) is very long (6 characters). It will be nice to be able to make it shorter. Two ideas: 1) Parameter how long the shortcut of the weekday name can be.

2) Method that takes the weekday and returns the String e.g:

dayFormat: (int day) {
    if(day == 7) return 'S';
}
ibecerramtz commented 1 year ago

Hello, I currently have the same problem, have you solved it? In my case I want to use the abbreviations of "DateFormat().dateSymbols.NARROWWEEKDAYS" with a single character, but the "dayFormat" parameter only takes a String and not a List.

Indumathi1195R commented 1 year ago

As per the shared information, we have checked and your requirement is “Customize the day format of the view header by the provided language of the Flutter Calendar”. By hiding default headers (headerHeight and viewHeaderHeight value as 0) and adding the custom headers you can achieve this requirement. We have prepared a simple sample for the same. Please find the sample from the following link. Also, we have KB documentation for custom header localization. Please find the documentation from the following link.

KB link: https://support.syncfusion.com/kb/article/11294/how-to-localize-the-custom-headers-text-in-the-flutter-calendar-sfcalendar

viewheader_locale.zip

We hope that this helps you. Please let us know if you need further assistance.