dateTimeSymbols top-level property

dynamic get dateTimeSymbols

This holds the symbols to be used for date/time formatting, indexed by locale. Note that it will be set differently during initialization, depending on what implementation we are using. By default, it is initialized to an instance of UninitializedLocaleData, so any attempt to use it will result in an informative error message.

Implementation

// TODO(alanknight): Have a valid type for this. Currently it can be an
// UninitializedLocaleData, Map, or LazyLocaleData.
dynamic get dateTimeSymbols => _dateTimeSymbols;
set dateTimeSymbols (dynamic symbols)

Set the dateTimeSymbols and invalidate cache.

Implementation

set dateTimeSymbols(dynamic symbols) {
  // With all the mechanisms we have now this should be sufficient. We can
  // have an UninitializedLocaleData which gives us the fallback locale, but
  // when we replace it we invalidate. With a LazyLocaleData we won't change
  // the results for a particular locale, it will just go from throwing to
  // being available. With a Map everything is available.
  _dateTimeSymbols = symbols;
  cachedDateSymbols = null;
  lastDateSymbolLocale = null;
}