formatRangeEndDate function
String
formatRangeEndDate(
- MaterialLocalizations localizations,
- Jalali? startDate,
- Jalali? endDate,
- Jalali? currentDate,
Returns an locale-appropriate string to describe the end of a date range.
If endDate
is null, then it defaults to 'End Date', otherwise if it
is in the same year as the startDate
and the currentDate
then it will
just use the short month day format (i.e. 'Jan 21'), otherwise it will
include the year (i.e. 'Jan 21, 2020').
Implementation
String formatRangeEndDate(MaterialLocalizations localizations,
Jalali? startDate, Jalali? endDate, Jalali? currentDate) {
return endDate == null
? 'تاریخ پایان'
: (startDate != null &&
startDate.year == endDate.year &&
startDate.year == currentDate!.year)
? endDate.formatShortMonthDay()
: endDate.formatShortDate();
}