make date picker accessible (#13502)
* make date picker accessible * make test file lookup location-independent * address some comments * always wrap in IgnorePointer * no bitmasks for flags and actions * recommend List<*>
This commit is contained in:
@@ -76,14 +76,18 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
|
||||
if (intl.DateFormat.localeExists(_localeName)) {
|
||||
_fullYearFormat = new intl.DateFormat.y(_localeName);
|
||||
_mediumDateFormat = new intl.DateFormat(kMediumDatePattern, _localeName);
|
||||
_longDateFormat = new intl.DateFormat.yMMMMEEEEd(_localeName);
|
||||
_yearMonthFormat = new intl.DateFormat('yMMMM', _localeName);
|
||||
} else if (intl.DateFormat.localeExists(locale.languageCode)) {
|
||||
_fullYearFormat = new intl.DateFormat.y(locale.languageCode);
|
||||
_mediumDateFormat = new intl.DateFormat(kMediumDatePattern, locale.languageCode);
|
||||
|
||||
_longDateFormat = new intl.DateFormat.yMMMMEEEEd(locale.languageCode);
|
||||
_yearMonthFormat = new intl.DateFormat('yMMMM', locale.languageCode);
|
||||
} else {
|
||||
_fullYearFormat = new intl.DateFormat.y();
|
||||
_mediumDateFormat = new intl.DateFormat(kMediumDatePattern);
|
||||
_longDateFormat = new intl.DateFormat.yMMMMEEEEd();
|
||||
_yearMonthFormat = new intl.DateFormat('yMMMM');
|
||||
}
|
||||
|
||||
@@ -115,6 +119,8 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
|
||||
|
||||
intl.DateFormat _mediumDateFormat;
|
||||
|
||||
intl.DateFormat _longDateFormat;
|
||||
|
||||
intl.DateFormat _yearMonthFormat;
|
||||
|
||||
static String _computeLocaleName(Locale locale) {
|
||||
@@ -169,6 +175,11 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
|
||||
return _mediumDateFormat.format(date);
|
||||
}
|
||||
|
||||
@override
|
||||
String formatFullDate(DateTime date) {
|
||||
return _longDateFormat.format(date);
|
||||
}
|
||||
|
||||
@override
|
||||
String formatMonthYear(DateTime date) {
|
||||
return _yearMonthFormat.format(date);
|
||||
|
||||
Reference in New Issue
Block a user