Formats the DateTime object using the provided pattern and optional locale. respects null dates.
String? tryFormat(String format) => isNull ? null : format.dateFormat().format(this!);