initializeDateFormatting function
This should be called for at least one locale
before any date formatting
methods are called. It sets up the lookup for date symbols using path.
The path parameter should end with a directory separator appropriate
for the platform.
Implementation
Future initializeDateFormatting(String locale, String filePath) {
var reader = new FileDataReader(path.join(filePath, 'symbols'));
initializeDateSymbols(() => new LazyLocaleData(
reader, _createDateSymbol, availableLocalesForDateFormatting));
var reader2 = new FileDataReader(path.join(filePath, 'patterns'));
initializeDatePatterns(() =>
new LazyLocaleData(reader2, (x) => x, availableLocalesForDateFormatting));
return initializeIndividualLocaleDateFormatting((symbols, patterns) {
return Future.wait(
<Future>[symbols.initLocale(locale), patterns.initLocale(locale)]);
});
}