-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom dayCustomClasses to daySelector + example in Demo.vue #548
base: master
Are you sure you want to change the base?
Conversation
@@ -193,7 +193,13 @@ | |||
|
|||
<div class="example"> | |||
<h3>Inline datepicker</h3> | |||
<datepicker :inline="true"></datepicker> | |||
<datepicker :inline="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this to a new example demo block please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
@@ -36,6 +36,10 @@ export default { | |||
pageTimestamp: Number, | |||
fullMonthName: Boolean, | |||
allowedToShowView: Function, | |||
dayCustomClasses: { | |||
type: Function, | |||
default: day => { return {} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the return {}? i.e maybe just default: day => {}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will update (was still getting to know Vue when I wrote this)
@@ -331,7 +335,8 @@ export default { | |||
'sat': day.isSaturday, | |||
'sun': day.isSunday, | |||
'highlight-start': day.isHighlightStart, | |||
'highlight-end': day.isHighlightEnd | |||
'highlight-end': day.isHighlightEnd, | |||
...this.dayCustomClasses(day) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the spread operator here? Isn't is just one function with variable output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see https://github.com/charliekassel/vuejs-datepicker/pull/548/files#diff-76ec76da861b1b1cdc6bba450fc735c2R370,
an object with key-value pairs is returned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply, completely lost track of this PR 😬
Will be making the code updates early next week
@@ -331,7 +335,8 @@ export default { | |||
'sat': day.isSaturday, | |||
'sun': day.isSunday, | |||
'highlight-start': day.isHighlightStart, | |||
'highlight-end': day.isHighlightEnd | |||
'highlight-end': day.isHighlightEnd, | |||
...this.dayCustomClasses(day) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see https://github.com/charliekassel/vuejs-datepicker/pull/548/files#diff-76ec76da861b1b1cdc6bba450fc735c2R370,
an object with key-value pairs is returned
@@ -36,6 +36,10 @@ export default { | |||
pageTimestamp: Number, | |||
fullMonthName: Boolean, | |||
allowedToShowView: Function, | |||
dayCustomClasses: { | |||
type: Function, | |||
default: day => { return {} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will update (was still getting to know Vue when I wrote this)
@@ -193,7 +193,13 @@ | |||
|
|||
<div class="example"> | |||
<h3>Inline datepicker</h3> | |||
<datepicker :inline="true"></datepicker> | |||
<datepicker :inline="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
Usage:
The above example code adds a "custom" CSS class randomly