Closed drelich closed 5 years ago
No option for that built-in, but you can simply do that by finding the first event and then use the option to set the month.
# Sort events, then grab the first one and convert it to a date
params[:start_date] = @events.order(created_at: :asc).first.start_time.to_date
Awesome! Thanks so much for a quick response and a hint at how to go about it :)
Cheers.
Hi,
First of all, thanks for this gem! It saved me a lot of headaches :)
Now, I know the calendar renders current month by default and there is an option to set it to whatever month I need. I was just wondering is there a simple way to render the month based on when the first event is on?
I thought about getting that first event record, get the date and then use it as the start_date parameter but maybe you're way ahead and added some sort of a much simpler approach?
Thanks.