showonne / vue-date

A datepicker component for Vue.js
https://showonne.github.io/vue-date/
MIT License
156 stars 65 forks source link

Minor usability enhancements #15

Open ghost opened 7 years ago

ghost commented 7 years ago

Just added these lines of code:

  1. German translation: case 'de': return {0: 'So', 1: 'Mo', 2: 'Di', 3: 'Mi', 4: 'Do', 5: 'Fr', 6: 'Sa'}[item];

case 'de': return {1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Okt', 11: 'Nov', 12: 'Dez'}[item];

  1. Navigation over border of year:

    prevMonthPreview() { if (this.tmpMonth === 0) { this.tmpMonth = 11; this.tmpYear = this.tmpYear - 1; } else { this.tmpMonth = this.tmpMonth - 1; } }, nextMonthPreview() { if (this.tmpMonth === 11) { this.tmpMonth = 0; this.tmpYear = this.tmpYear + 1; } else { this.tmpMonth = this.tmpMonth + 1; } }

  2. Clear (set back to default view) clear() { this.panelType = 'date'; this.$emit('input', this.range ? ['', ''] : ''); }

  3. not done yet: reset to selected: If you already picked a date or range and you open the datepicker and change the year/month and close it without to adopt that date and reopen it date and month still have the last selected values, it should be set back to init state on panelType = 'date' and the list should be the one where your date is visible

Best + thx for your work! PJ