Ionic2-Calendar
Ionic2-Calendar copied to clipboard
Showing multi-day events on the calendar with CSS
I'd like to know if its possible to do this:
As shown on the image, for example for the days 09, 10 and 11, I'd like to mark on the calendar multi-day events just like that. Would that be possible? And if yes, how would you handle it if there's a multi-day event going form the 7th to the 8th or more?
Thanks anyways!
@aldimirprincipal Unfortunately this is not supported by default. You may be able to use monthviewDisplayEventTemplate option provide some custom look and feel. But you also need to consider what if there are multiple events happen on a single day, how do you want to display them?
@twinssbc My idea was having it the same way google does, adding more space if needed. Thanks for the answer tho!
One last question, how could I get the date of the current selected day?
The "15 MAR" is hard-coded right now, and I would want to show the day the user selected. How would I do that in the html?
@aldimirprincipal When you use the calendar, you will bind a a currentDate variable. When the selected date is changed, the currentDate will also be changed.
@twinssbc currentDate as itself is not anything, but if I use calendar.currentDate it gives me Monday 05 for all days.
@aldimirprincipal Could you provide more code to show how do you use the calendar in HTML?
@twinssbc Sure! Here it is:
and in the ts: