47
Views
8
Comments
[FullCalendar] Get current month on a button click
Question
nexusae0-weekcalendar-icon-png
Web icon
Forge asset by Joop Stringer
Joop, I'm sorry for my little expertise (I'm a beginner)...

I have a reference to the FullCalendar component in my project, but how can I gather the current month/year by a button click, once I can't access the 'CalendarPlaceHolder' directly from my project?
2011-06-15 10-51-22
Joop Stringer
Not sure what you want to achieve .. do you want the calendar to "jump" to a specific date by the push of a button somewhere on the screen ? If so ... just add a button, add a screen action like this

Just set the startdate and refresh the webblock et voila !
2023-02-10 19-42-59
João Melo
 
MVP
No, that's not what I want.

Let's suppose that the user have navigated to a specific month, via browser/javascript. I want to pass this month to the server-side so when I refresh the webblock, it will be at the same month.
2011-06-15 10-51-22
Joop Stringer
Yeah that's what this does ... set the startDate parameter to the selected month/year and refresh the webblock.
That will trigger a renewed AJAX call to get the JSON data from the backend via the JSONurl in the webblock
2023-02-10 19-42-59
João Melo
 
MVP
JSONUrl? Where is it? Actually I don't understand how to get the JSON stuff working here.
 
I made this: On a button click, I pass some parameters to the server that triggers an SQL Query and refreshes the webblock. It's working perfectly. But still with a fixed 'startDate'.
 
Now I need 2 things, and this is flooding my mind...
1. I got to pass to the server the month/year presented in the current view together with other parameters as filters. So my screen action can refresh the webblock preserving the month/year that the user is seeing.
2. When the user navigate to the next or previous month, I need to refresh the Events List for the new month.
2011-06-15 10-51-22
Joop Stringer
Have a look at the demopage.
On the left there is on the bottom the script to load data via JSON
Otherwise take a look at the following link https://arshaw.com/fullcalendar/docs/event_data/events_json_feed/

The calendarblock automatically calls the JSON file whenever a user switches month/day/week
Check the CalendarJSON page in the OML
2023-02-10 19-42-59
João Melo
 
MVP
Joop! It worked perfectly! I took a look at the documentation of the jquery plugin and everything went fine.

I have made a few changes to the original project so I can pass other parameters to the FullCalendar component by a button click and by the events that trigger the AJAX to process.

Really thank you, and once I'm able to help improve the project, I'll do it.
UserImage.jpg
Sanyam Chaurasia

I am facing the same problem in Angular web app where I am trying to retain the current Month/Week/Day Page. Will it be possible to work with this?
I don't want to send it to server, even saving it in local storage would suffice can you please tell me how you did it?

UserImage.jpg
Fisio São Brás
Hi guys,
Is possible to get the Id of a click event and then pass as an input to a page?

thanks

Best Regards
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.