Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VDatePickerMonthTable.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Mixins
  2. import DatePickerTable from './mixins/date-picker-table';
  3. // Utils
  4. import { pad, createNativeLocaleFormatter } from './util';
  5. import mixins from '../../util/mixins';
  6. export default mixins(DatePickerTable
  7. /* @vue/component */
  8. ).extend({
  9. name: 'v-date-picker-month-table',
  10. computed: {
  11. formatter: function formatter() {
  12. return this.format || createNativeLocaleFormatter(this.locale, { month: 'short', timeZone: 'UTC' }, { start: 5, length: 2 });
  13. }
  14. },
  15. methods: {
  16. calculateTableDate: function calculateTableDate(delta) {
  17. return '' + (parseInt(this.tableDate, 10) + Math.sign(delta || 1));
  18. },
  19. genTBody: function genTBody() {
  20. var _this = this;
  21. var children = [];
  22. var cols = Array(3).fill(null);
  23. var rows = 12 / cols.length;
  24. var _loop = function _loop(row) {
  25. var tds = cols.map(function (_, col) {
  26. var month = row * cols.length + col;
  27. var date = _this.displayedYear + '-' + pad(month + 1);
  28. return _this.$createElement('td', {
  29. key: month
  30. }, [_this.genButton(date, false, 'month', _this.formatter)]);
  31. });
  32. children.push(_this.$createElement('tr', {
  33. key: row
  34. }, tds));
  35. };
  36. for (var row = 0; row < rows; row++) {
  37. _loop(row);
  38. }
  39. return this.$createElement('tbody', children);
  40. }
  41. },
  42. render: function render() {
  43. return this.genTable('v-date-picker-table v-date-picker-table--month', [this.genTBody()], this.calculateTableDate);
  44. }
  45. });
  46. //# sourceMappingURL=VDatePickerMonthTable.js.map