chore(date-picker): only modify if locale is "en"

This commit is contained in:
Eric Liu 2020-02-03 15:39:12 -08:00
commit ac0c54943c

View file

@ -43,7 +43,7 @@ function updateMonthNode(instance) {
function createCalendar({ options, base, input, dispatch }) { function createCalendar({ options, base, input, dispatch }) {
let locale = options.locale; let locale = options.locale;
if (l10n.en) { if (options.locale === 'en' && l10n && l10n.en) {
l10n.en.weekdays.shorthand.forEach((_, index) => { l10n.en.weekdays.shorthand.forEach((_, index) => {
const shorthand = _.slice(0, 2); const shorthand = _.slice(0, 2);
l10n.en.weekdays.shorthand[index] = shorthand === 'Th' ? 'Th' : shorthand.charAt(0); l10n.en.weekdays.shorthand[index] = shorthand === 'Th' ? 'Th' : shorthand.charAt(0);