weekdayName method
Returns the name of the weekday for the given date.
If isHalfName
is true
, returns the abbreviated name (e.g., "Mon" for Monday).
Example:
DateTime date = DateTime.now();
print(date.weekdayName()); // Output: Monday
Implementation
String? weekdayName({bool isHalfName = false}) {
if (isNull) return null;
return weekday.toWeekDay(isHalfName: isHalfName);
}