Skip to content

Commit

Permalink
feat(quasar): Hide days not belonging to the current month in date pi…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Jul 31, 2019
1 parent b8f7aef commit 294c7d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/components/datetime/QDate.js
Expand Up @@ -208,7 +208,7 @@ export default Vue.extend({
const len = days < 0 ? days + 7 : days
if (len < 6) {
for (let i = endDay - len; i <= endDay; i++) {
res.push({ i })
res.push({ i, fill: true })
}
}

Expand Down Expand Up @@ -249,7 +249,7 @@ export default Vue.extend({
if (left > 0) {
const afterDays = 7 - left
for (let i = 1; i <= afterDays; i++) {
res.push({ i })
res.push({ i, fill: true })
}
}

Expand Down Expand Up @@ -479,7 +479,7 @@ export default Vue.extend({
key: this.innerModel.year + '/' + this.innerModel.month,
staticClass: 'q-date__calendar-days fit'
}, this.days.map(day => h('div', {
staticClass: `q-date__calendar-item q-date__calendar-item--${day.in === true ? 'in' : 'out'}`
staticClass: `q-date__calendar-item q-date__calendar-item--${day.fill === true ? 'fill' : (day.in === true ? 'in' : 'out')}`
}, [
day.in === true
? h(QBtn, {
Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/datetime/date.styl
Expand Up @@ -80,6 +80,9 @@
&--out
opacity .18

&--fill
visibility hidden

&__calendar-days-container
height 75%

Expand Down

0 comments on commit 294c7d2

Please sign in to comment.