Commit e8a990f54f6335c19d8de424b75b0f5e4e27bf86
1 parent
a781ad1a
hide ranges in month and year tables
Showing
2 changed files
with
2 additions
and
9 deletions
Show diff stats
src/components/date-picker/base/month-table.vue
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | </div> |
13 | 13 | </template> |
14 | 14 | <script> |
15 | - import { clearHours, isInRange } from '../util'; | |
15 | + import { clearHours } from '../util'; | |
16 | 16 | import { deepCopy } from '../../../utils/assist'; |
17 | 17 | import Locale from '../../../mixins/locale'; |
18 | 18 | import mixin from './mixin'; |
... | ... | @@ -37,8 +37,6 @@ |
37 | 37 | }; |
38 | 38 | |
39 | 39 | const tableYear = this.tableDate.getFullYear(); |
40 | - const rangeStart = this.rangeState.from && clearHours(new Date(this.rangeState.from.getFullYear(), this.rangeState.from.getMonth(), 1)); | |
41 | - const rangeEnd = this.rangeState.to && clearHours(new Date(this.rangeState.to.getFullYear(), this.rangeState.to.getMonth(), 1)); | |
42 | 40 | const selectedDays = this.dates.filter(Boolean).map(date => clearHours(new Date(date.getFullYear(), date.getMonth(), 1))); |
43 | 41 | |
44 | 42 | for (let i = 0; i < 12; i++) { |
... | ... | @@ -46,7 +44,6 @@ |
46 | 44 | cell.date = new Date(tableYear, i, 1); |
47 | 45 | cell.text = this.tCell(i + 1); |
48 | 46 | const time = clearHours(cell.date); |
49 | - cell.range = isInRange(time, rangeStart, rangeEnd); | |
50 | 47 | cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'month'; |
51 | 48 | cell.selected = selectedDays.includes(time); |
52 | 49 | cells.push(cell); | ... | ... |
src/components/date-picker/base/year-table.vue
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | </div> |
12 | 12 | </template> |
13 | 13 | <script> |
14 | - import { clearHours, isInRange } from '../util'; | |
14 | + import { clearHours } from '../util'; | |
15 | 15 | import { deepCopy } from '../../../utils/assist'; |
16 | 16 | import mixin from './mixin'; |
17 | 17 | import prefixCls from './prefixCls'; |
... | ... | @@ -38,17 +38,13 @@ |
38 | 38 | disabled: false |
39 | 39 | }; |
40 | 40 | |
41 | - const rangeStart = this.rangeState.from && clearHours(new Date(this.rangeState.from.getFullYear(), 0, 1)); | |
42 | - const rangeEnd = this.rangeState.to && clearHours(new Date(this.rangeState.to.getFullYear(), 0, 1)); | |
43 | 41 | const selectedDays = this.dates.filter(Boolean).map(date => clearHours(new Date(date.getFullYear(), 0, 1))); |
44 | 42 | |
45 | - | |
46 | 43 | for (let i = 0; i < 10; i++) { |
47 | 44 | const cell = deepCopy(cell_tmpl); |
48 | 45 | cell.date = new Date(this.startYear + i, 0, 1); |
49 | 46 | cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'year'; |
50 | 47 | const time = clearHours(cell.date); |
51 | - cell.range = isInRange(time, rangeStart, rangeEnd); | |
52 | 48 | cell.selected = selectedDays.includes(time); |
53 | 49 | cells.push(cell); |
54 | 50 | } | ... | ... |