Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale date has not been initialized when use24HourFormat set to false #69

Open
AniketDhanak opened this issue Jul 15, 2022 · 2 comments

Comments

@AniketDhanak
Copy link

AniketDhanak commented Jul 15, 2022

 [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LocaleDataException: Locale data has not been initialized, call initializeDateFormatting(<locale>).
E/flutter ( 4297): #0      UninitializedLocaleData._throwException (package:intl/src/intl_helpers.dart:80:5)
E/flutter ( 4297): #1      UninitializedLocaleData.containsKey (package:intl/src/intl_helpers.dart:74:7)
E/flutter ( 4297): #2      DateFormat.localeExists (package:intl/src/intl/date_format.dart:834:28)
E/flutter ( 4297): #3      verifiedLocale (package:intl/src/intl_helpers.dart:159:19)
E/flutter ( 4297): #4      new DateFormat (package:intl/src/intl/date_format.dart:266:27)
E/flutter ( 4297): #5      _DateTimePickerState.set12HourTimeValues (package:date_time_picker/date_time_picker.dart:763:20)
E/flutter ( 4297): #6      _DateTimePickerState._showDateTimePickerDialog (package:date_time_picker/date_time_picker.dart:876:11)
E/flutter ( 4297): <asynchronous suspension>
E/flutter ( 4297): 

It is only coming for use24HourFormat: true,
If it is set to false it doesn't throw error

@AniketDhanak AniketDhanak changed the title Locale date has not been initialized Locale date has not been initialized when use24HourFormat set to true Jul 15, 2022
@AniketDhanak AniketDhanak changed the title Locale date has not been initialized when use24HourFormat set to true Locale date has not been initialized when use24HourFormat set to false Jul 15, 2022
@Awesomeplayer165
Copy link

Awesomeplayer165 commented Feb 21, 2023

I also have this problem. Is there any update on this?

I tried calling initializeDateFormatting() myself but to no avail

@saurabhmore
Copy link

Facing the same issue needed 12hr format with locale support.
Is this issue fixed??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants