format method
Format and output the date.
Enter the format of the date and time in format.
Implementation
String format(String format) {
assert(format.isNotEmpty, "The format is empty.");
return DateFormat(format).format(this).replaceAll(
"ww",
weekNumber.toString().padLeft(2, "0"),
);
}