-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
I'd like to be able to customize the data of 1 or multiple locales
For example, I'd like to change the short month of en_US of September from Sep to Sept
I couldn't find in the documentation anything about it. I managed to do what I wanted with:
test('Counter increments smoke test', () async {
await initializeDateFormatting('en_US', null);
final initialDateTimeSymbols = dateTimeSymbolMap();
final en = initialDateTimeSymbols['en_US']!;
final serialized = en.serializeToMap();
serialized['STANDALONESHORTMONTHS'] = [
...serialized['STANDALONESHORTMONTHS'],
]..[8] = 'Sept';
final modifiedEn = DateSymbols.deserializeFromMap(serialized);
initializeDateFormattingCustom(
locale: 'en_US',
patterns: dateTimePatternMap()['en_US'],
symbols: modifiedEn,
);
print(DateFormat.MMM('en_US').format(DateTime(2025, 9, 22))); // Prints "Sept".
});But it does look like it was meant to be done.
Is there a way to customize the data? If yes how? If not, is it something that could be considered?
Metadata
Metadata
Assignees
Labels
type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug