When the user clicks book now and the calendar shows the size is wrong like it has not initialised.
If i make the calendar shown all the time then its perfect, it just does not seem to like showing a calendar that was previously hidden.
When toggling Calendar visibility, you have to initiate an updateSize. I use a simple JS function that I call on click of the button that toggles the visibility. Also useful if the calendar is on a modal that isn’t shown when the calendar is rendered.
function resizecalendar(el) {
dmx.parse(el + '.updateSize()');
}
You could use the onUpdated dynamic event for the variable to trigger it sending the ID of the calendar element as a parameter
This can be done via a Dynamic Event. Maybe add the Dynamic Event on click to Update Size (available in the data picker under calendar). Few other options there too.
I did it with the built in Dynamic Event, I did find it there after adding the on updated, I also had to add phCal.today() to update my events or they all looks like massive blocks.
I know I am taking my own topic, off topic, but while I am at it, anyone know how to disable the previous button when less than today, and the next button when greater than today + 2 weeks.
Tried to do this recently and spent too much time on it so skipped past it for now, something to go back to, so interested to hear of any work-around...
Being able to set a minimum date would be great, as with a date picker. Couldn't figure it out though!
Glad it worked for you, now my last trick on this calendar is to distinguish which event was clicked by changing its colour when its selected.
If I figure it out I will post, but if anyone else already knows how, please share.
This should be my last question on this poor single thread.
I only have events starting at 9am and ending at 10pm, so to show all the additional times makes the page very long for no good reason.
I have done this to remove all the unwanted times in my css file
Question is can anyone think of a way to get the same result but more dynamically, as with this current solution if an event suddenly starts at 8am for some reason, or ends past 10pm it will break, so any way to do this dynamically based upon what event source earliest start date and latest end date.