File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
lib/internal/Magento/Framework/View/Element/Html Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -107,9 +107,20 @@ protected function _toHtml()
107107 ]
108108 );
109109
110- // get "today" and "week" words
111- $ this ->assign ('today ' , $ this ->encoder ->encode ($ localeData ['fields ' ]['day ' ]['relative ' ]['0 ' ]));
112- $ this ->assign ('week ' , $ this ->encoder ->encode ($ localeData ['fields ' ]['week ' ]['dn ' ]));
110+ /**
111+ * Get "today" and "week" words
112+ *
113+ * Fields value in the current position have been added to ICU Data tables,
114+ * starting with ICU library version 51.1.
115+ * Due to fact that we do not use these variables in templates, we do not initialize them for older versions
116+ *
117+ * @see https://github.com/unicode-org/icu/blob/release-50-2/icu4c/source/data/locales/en.txt
118+ * @see https://github.com/unicode-org/icu/blob/release-51-2/icu4c/source/data/locales/en.txt
119+ */
120+ if ($ localeData ->get ('fields ' )) {
121+ $ this ->assign ('today ' , $ this ->encoder ->encode ($ localeData ['fields ' ]['day ' ]['relative ' ]['0 ' ]));
122+ $ this ->assign ('week ' , $ this ->encoder ->encode ($ localeData ['fields ' ]['week ' ]['dn ' ]));
123+ }
113124
114125 // get "am" & "pm" words
115126 $ this ->assign ('am ' , $ this ->encoder ->encode ($ localeData ['calendar ' ]['gregorian ' ]['AmPmMarkers ' ]['0 ' ]));
You can’t perform that action at this time.
0 commit comments