formatDateTime function
Formats a DateTime object into a string.
Allows specifying whether to use a 24-hour format, language code, country code, and whether to show time.
Implementation
Future<String> formatDateTime(
DateTime dateTime, {
bool use24HourFormat = false,
String languageCode = 'en',
bool showTime = true,
String? countryCode,
}) async {
final dateFormatter = await retrieveDateFormatter(
use24HourFormat: use24HourFormat,
languageCode: languageCode,
countryCode: countryCode,
showTime: showTime,
);
return dateFormatter.format(dateTime);
}