Skip to content

Commit

Permalink
fix: error due to l10n exported with "default" field. (#1271)
Browse files Browse the repository at this point in the history
* Error due to l10n exports with default field.

Hello!
We have an error due to this part of code because it is outside the component and after build it causes error because this code use global l10n module in bundle with nested `default` filed. That is we should apply it like `l10n.default.en` and etc or replace this code into component module.
Our team would be eternally grateful if you approve this pull request!

* Correct formatting

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Lee Chase <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2021
1 parent 5cd039f commit 97781a4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions packages/core/src/components/cv-date-picker/cv-date-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ import { uidMixin, themeMixin, carbonPrefixMixin } from '../../mixins';
import Calendar16 from '@carbon/icons-vue/es/calendar/16';
import CvWrapper from '../cv-wrapper/_cv-wrapper';
// Weekdays shorthand for english locale
l10n.en.weekdays.shorthand.forEach((day, index) => {
const currentDay = l10n.en.weekdays.shorthand;
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
currentDay[index] = 'Th';
} else {
currentDay[index] = currentDay[index].charAt(0);
}
});
export default {
name: 'CvDatePicker',
mixins: [uidMixin, themeMixin, carbonPrefixMixin],
Expand Down Expand Up @@ -338,6 +328,17 @@ export default {
this.$refs.todate.click();
},
},
created() {
// Weekdays shorthand for english locale
l10n.en.weekdays.shorthand.forEach((day, index) => {
const currentDay = l10n.en.weekdays.shorthand;
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
currentDay[index] = 'Th';
} else {
currentDay[index] = currentDay[index].charAt(0);
}
});
},
mounted() {
this.initFlatpickr();
this.checkSlots();
Expand Down

0 comments on commit 97781a4

Please sign in to comment.