retrieveDateFormatter function
Retrieves a DateFormat
object based on locale and preferences.
Initializes the locale if needed before creating the date formatter.
Implementation
Future<DateFormat> retrieveDateFormatter({
bool use24HourFormat = false,
String languageCode = 'en',
bool showTime = true,
String? countryCode,
}) async {
final locale = _buildLocale(languageCode, countryCode);
await _initializeLocaleIfNeeded(locale);
return createDateFormatter(locale, showTime, use24HourFormat);
}