so I use intl package. here is my code
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
String toString(DateTime originalDate) {
initializeDateFormatting();
final DateFormat formatter = DateFormat("EEEE, d MMMM. HH:mm zzz", "id");
final String formatted = formatter.format(originalDate);
return formatted;
}
as you can see, I am trying to make DateTime as a string using "EEEE, d MMMM. HH:mm zzz"
format. so I expect I will have the result date string like this:
Senin, 24 Mei. 18:00 WIB.
but I have error whenever I have that zzz
in the format. if I remove the zzz
then it should be fine.
I guess I need to put a TimeZone ID in my code above. because I has this unimplemented error in date_format_field.dart
file
String formatTimeZone(DateTime date) {
throw UnimplementedError();
}
but I don't know how to set the timezoneID to my code. my TimeZone ID is "Asia/Jakarta"
I am okay if you have different code or not using intl package at all. as long as I can specify the timezone and the locale ID