fix(date-picker): revert back to default import

#232

Reverts 6d5f1e5
This commit is contained in:
Eric Liu 2020-08-15 06:14:46 -07:00
commit 633d898aad

View file

@ -1,6 +1,6 @@
import * as flatpickr from "flatpickr"; import flatpickr from "flatpickr";
import * as l10n from "flatpickr/dist/l10n/index.js"; import l10n from "flatpickr/dist/l10n/index.js";
import * as rangePlugin from "flatpickr/dist/plugins/rangePlugin"; import rangePlugin from "flatpickr/dist/plugins/rangePlugin";
function updateClasses(instance) { function updateClasses(instance) {
const { const {
@ -50,14 +50,14 @@ function updateMonthNode(instance) {
function createCalendar({ options, base, input, dispatch }) { function createCalendar({ options, base, input, dispatch }) {
let locale = options.locale; let locale = options.locale;
if (options.locale === "en" && l10n.default && l10n.default.en) { if (options.locale === "en" && l10n && l10n.en) {
l10n.default.en.weekdays.shorthand.forEach((_, index) => { l10n.en.weekdays.shorthand.forEach((_, index) => {
const shorthand = _.slice(0, 2); const shorthand = _.slice(0, 2);
l10n.default.en.weekdays.shorthand[index] = l10n.en.weekdays.shorthand[index] =
shorthand === "Th" ? "Th" : shorthand.charAt(0); shorthand === "Th" ? "Th" : shorthand.charAt(0);
}); });
locale = l10n.default.en; locale = l10n.en;
} }
return new flatpickr(base, { return new flatpickr(base, {