Skip to content
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

how to get the date info by use event-render slot on month view #59

Closed
litoxy opened this issue Feb 28, 2019 · 5 comments
Closed

how to get the date info by use event-render slot on month view #59

litoxy opened this issue Feb 28, 2019 · 5 comments

Comments

@litoxy
Copy link

litoxy commented Feb 28, 2019

Hi~
first apologize for my poor englist

my question is how to get the date info by use event-render slot on month view

this is my code
<vue-cal @day-focus="dayClick" > <div slot="event-renderer" slot-scope="{ event,view}"> //how to get the date info in this event ? <div class="vuecal__event-title" v-html="event.title" /> </div> </vue-cal>

@DuredhelFinceleb
Copy link

the date info should be into event.startDate and event.endDate
if you want the full date time this will be event.start and event.end (if time is false or your event is an all day one (ie event.allDay=true) then event.start/end are the same than event.startDate/endDate)
and time info is into event.startTime and event.endTime

so to display the start and end dates into your slot you would have something like this

<div class="vuecal__event-time">
      <strong>Event start:</strong> <span>{{ event.startDate }}</span><br/>
      <strong>Event end:</strong> <span>{{ event.endDate }}</span>
</div>

@DuredhelFinceleb
Copy link

note that if you have set time to false, you'll have to use an other class because vuecal__event-time won't be available. See https://antoniandre.github.io/vue-cal/#ex--custom-event-rendering

@antoniandre
Copy link
Owner

Hi @lllito,

@DuredhelFinceleb, gave a good example that you can follow. 👌

To help you out here is a Codepen with what you want: https://codepen.io/antoniandre/pen/jJbygw?editors=1010


To set custom event rendering please refer to this example: https://antoniandre.github.io/vue-cal/#ex--custom-event-rendering.
Now in this example, events are not displayed on month view, so you will need to add the attribute :events-on-month-view="true". Refer to this example: https://antoniandre.github.io/vue-cal/#ex--events-on-month-view

Let me know if you still need assistance.

@litoxy
Copy link
Author

litoxy commented Mar 1, 2019

thanks so much

@antoniandre
Copy link
Owner

👌 Closing the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants