Full calendar display in form

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Full calendar display in form

Post by thomahawk »

Hi
I expected I could create a form and just set "date picker" to display a specific calendar. Where is the option so the usual calendar table can be displayed? For example month by month with a field for each day?

When I set "date picker" there appear only three pull downs for day, month, year.

Also it should display the already occupied days as set in Calguy Calendar.

Any help appreciated
Thom
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Full calendar display in form

Post by DIGI3 »

I think more context is needed: what are you using to create the form? (formbuilder, cgbetterforms, straight html, or are you talking about something generated from within the CGCalendar Module?)

A lot of people use jQueryUI for a calendar datepicker:

Code: Select all

https://jqueryui.com/datepicker/
As for pulling in the booked dates from the CGCalendar module, that will require some Smarty and jQueryUI datepicker API work, unless you are using some sort of booking module that works with CGCalendar.
Not getting the answer you need? CMSMS support options
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Full calendar display in form

Post by thomahawk »

My bad, you are right I forgot to mention the main thing, silly me.

Yes, this is in FormBuilder, where I choose "date picker". There seems to be no calender display like "fullcalender" in CGCalendar.

The ideal thing would be just to display a calendar showing occupied days in red and click on an available one and then in a popup put in the reservation data. I suppose this should be done starting with CGCalendar?

Thinking this will be complicated I did what I supposed is the shorter route, showing calendar on top and form with a "date picker", one has to chose a date that is not red on the calendar above.

This is my page http://burgerg9.myhostpoint.ch/reservation.html

Formatting that calendar was a really bigger task then I thought. I had over 10 hours until I was able to remove unwanted space and scrollbar, the event detail link, change the event box color and move it upwards.

I suppose formatting CGcalendar to work as I initially intended would be even much more complicated?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1627
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Full calendar display in form

Post by DIGI3 »

There's a lot of different ways to go about this, but all require some thought and planning. I would probably modify the form template to use the jqueryui datepicker, then create a cgcalendar template to build the configuration that tells it which days are unavailable. 20 people will give you 20 other solutions though.
Not getting the answer you need? CMSMS support options
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Full calendar display in form

Post by thomahawk »

Thank you DIGI3, the jQuery UI would be a great way. I let my less elegant solution for now and maybe if I get more time later to work on this and try the jQuery UI.

Planning is always an impossible thing without knowing a module/thing already. One has to first work into it before being able to say how much time it will take. I already got it very wrong with formbuilder and that is one I thought I knew...
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Full calendar display in form

Post by thomahawk »

One more thing I struggle with. The CGcalendar in frontend should only show events of one category. I tried

{cms_module module="CGCalendar" category="Forsthaus belegt"}

but still it shows the other category too. The category name matches exactly the category I set in backend. What did I wrong here?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Full calendar display in form

Post by velden »

I would try a category without a white space in the name but that's just a guess.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Full calendar display in form

Post by thomahawk »

velden wrote:I would try a category without a white space in the name but that's just a guess.
Good idea. But unfortunately "Forsthaus-besetzt" is also not working. If I could find anything to differentiate those other event fields via CSS I could simply hide them, but I don't see how to address them, despite the fact that they look different (they are white on white and cover the day number, but this seems all inline coded).
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Full calendar display in form

Post by thomahawk »

Well, I was able to identify the css element box and make it transparent with opacity 0.3, then I made the event text disappear (.fc-content). I gave the "place occupied" events a red color and the other events white, so the transparent red is still well visible and the white can barely be noted. That solved my problem.

.fc-event {
height: 31px;
width: 36px;
position: absolute;
top: -1px;
opacity: 0.3;
}

.fc-content {
display: none;
}
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Full calendar display in form

Post by velden »

Just remembered this:
viewtopic.php?f=7&t=78121
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

Re: Full calendar display in form

Post by thomahawk »

velden wrote:Just remembered this:
viewtopic.php?f=7&t=78121
Thank you Velden. Right, this still did the trick. Strange I was not able to find that topic before in the forum.
Post Reply

Return to “Modules/Add-Ons”