hilongjw / vue-datepicker

[Deprecated] calendar and datepicker component with material design for Vue.js
http://hilongjw.github.io/vue-datepicker/demo.html
MIT License
702 stars 207 forks source link

Limited day is clickable #88

Open antonkomarev opened 7 years ago

antonkomarev commented 7 years ago

selection_227

Dates are limited from 4th of february till 23rd. Dates highlighted with green marker are unclickable. Dates marked with red - are broken: could be selected!

Using in Vue.js v1

Note: Days from previous month are all unclickable.

n8-dev commented 7 years ago

+1

IMO red should just take you to the next month, not actually be selectable.

antonkomarev commented 7 years ago

@n8-sd Yes, but if the are unavailable to be selected - they should be unclickable.

vwakeup commented 7 years ago

find code var passiveDaysAtFinal = 42 - days.length; for (var _i2 = 1; _i2 <= passiveDaysAtFinal; _i2++) { var _passiveDay = { value: _i2, inMonth: false, action: 'next', unavailable: false, checked: false, moment: (0, _moment2.default)(currentMoment).add(1, 'months').date(_i2) };

then move up before
if (this.limit.length > 0) {

hu3402379 commented 7 years ago

find code and change unavailable from false to true.

for (let i = 0; i < firstDay - (this.option.SundayFirst ? 0 : 1); i++) { let passiveDay = { value: previousMonth.daysInMonth() - (i), inMonth: false, action: 'previous', unavailable: true, checked: false, moment: moment(currentMoment).date(1).subtract(i + 1, 'days') } days.unshift(passiveDay) }

let passiveDaysAtFinal = 42 - days.length for (let i = 1; i <= passiveDaysAtFinal; i++) { let passiveDay = { value: i, inMonth: false, action: 'next', unavailable: true, checked: false, moment: moment(currentMoment).add(1, 'months').date(i) } days.push(passiveDay) }

JStrebeyko commented 6 years ago

thank you! :)