FullCalendar not showing allDay events correctly - fullcalendar

Why an event like this will stop on the 9th and not show in the 10th on the calendar? To me this event is inclusive of the 10th. I believe it work find in the 1v of the calendar and changed when I upgraded to 2v.
{
allDay: true,
title: 'Long Event',
start: '2014-09-07',
end: '2014-09-10'
},

Both v1 and v2 treat the endParam as denoting the end of the last day being exclusive.
According to the documentation of v2 it is stated that
endParam
A parameter of this name will be sent to each JSON event feed. It describes the exclusive end of the interval being fetched.
If you take a look at the documentation for v1:
endParam
The value of this GET parameter will be a UNIX timestamp denoting the end of the last visible day (exclusive).

Related

Modify Google Calendar recurring Event using API

I am using Google Calendar API to create/modify recurring events
for e.g. - there is an event (Say ABC) having recurring events on Monday, Wednesday & Thursday till 31st January 2021 (say 30 occurrences). While creating this event, I calculated number of US holidays coming in this schedule (suppose 1) and increased the COUNT by that number (which will be now 31) and later delete those instances which were occurring those holidays (like 26th Nov, 27th Nov, 24th December etc). Everything works fine till here.
Now I've to add an attendee to this event which I'm able to do by sending a PATCH request (reference) with updated attendees list. This updates the attendees list but it undo's the instances that I deleted. I want recurring event to remain as it is.
TIA
After succesfully deleting the spare event instances, you should be able to add invitees to the non-deleted instance by specifying the recurringEventId as eventId
If for whatever reason this is not working as intended you can perform the following workaround:
Use the method Events: instances with the option showDeleted:false to retrieve the ids of all not deleted event recurrences
Use the method Events: patch in a loop specifying as eventId all single event ids retrieved in the step above
Mind:
While the recurringEventId should look something like qgthctibhb7755q02hnm3cdb3s, the id of each single instance should look something like qgthctibhb7755q02hnm3cdb3s_20201104 (the date is included in the id)

Render endDate as if they're inclusive

I realise that by design it's intended that fullcalendar endDates are exclusive, but I'm looking for help to work with that given my constraints.
Data stored is simple UK date format:
YYYY-MM-DD
start: 2015-01-18
end: 2015-01-19
I'd like to keep the look of the plain all day events, rather than the timestamped style and I cant just +1 end date as what happens come the end of the month?
I've tried poking through the source js, to remove any -1 corrections in there. That works for my multiday events, but then makes one day events look like two day events.
Scenario. Users select a start date and end date (of their holidays)
So that would be perhaps monday to friday. Users dont select a time, just the date. Naturally they'll select the dates they want for holiday as inclusive.
Expected behaviour.
18/1/2015 - 18/1/2015 would highlight one full day.
18/1/2015 - 19/1/2015 would highlight two full days (inclusive days)
18/1/2015 - 20/1/2015 would highlight three full days (inclusive days)
etc..etc
Actual behaviour.
18/1/2015 - 18/1/2015 will highlight one full day.
18/1/2015 - 19/1/2015 will highlight one full day (exclusive endday)
18/1/2015 - 20/1/2015 will highlight two full days (exclusive endday)
Open to suggestions, fixes, workarounds, dirty hacks.
Thanks
It's possible I'm misunderstanding, but here's a possible solution.
Inside of eventDataTransform (which is called for every event), add a time to each start and end date. Something like
eventDataTransform: function(eventData){
eventData.start.startOf('day');
eventData.start.endOf('day');
}
Thanks to slicedtoad for the hint with eventDataTransform. I just had to find the correct way to actually add 1 to the end date. For any one curious (and I'm not sure I fully understand how it works), but a one day event is still a one day event even though it appears we're add one to the end?
events:
{
url: '<?php echo base_url();?>index.php/jsonfeed',
error: function()
{
alert('error');
},
},
eventDataTransform: function(eventData)
{
eventData.end = moment(eventData.end).add(1, 'days').format();
return eventData;
},

Fullcalendar doesn't show correctly event in month mode

I have a problem with the fullcalendar, I have an event that occurs on day 3 and day 4, when a event ends before 9am, the month mode is shown only one day, look:
Week: (ending before 9am)
Month:
Week: (ending after 9am)
Month:
How I fix it? I want to show the event in the Month on both days.
You need to change the nextDayThreshold properties to another hour for the event to display according to your needs.
From the docs:
When an event's end time spans into another day, the minimum time it must be in order for it to render as if it were on that day.
Duration, default: "09:00:00" (9am)
Only affects timed events that appear on whole-days. Whole-day cells
occur in month view, basicDay, basicWeek and the all-day slots in the
agenda views.
Example (docs)
{ start: '2014-02-04T20:00:00', end: '2014-02-05T02:00:00' }
// goes from 8pm to 2am the next day
More info at:
http://fullcalendar.io/docs/event_rendering/nextDayThreshold/

fullCalendar read data for 40 days

fullCalendar readdata for 40 days
I want to use fullcalendar, something like this url
http://www.mikesmithdev.com/fullcalendar-jquery-ui-modal/
and for data sourse I use method
$("#calendar").fullCalendar("addEventSource", ''/control/action/?parameters');
where $evtUrl - is url with data filter spacified without date period.
debugging action in I see 2 parameters added
[start] => 2014-09-28
[end] => 2014-11-09
But I expected date period for current week(7 days), but it looks like that form today 10-18 period is -20 and +20 days
If there is a way to set period in seven days and change it by clicking to left/right button ?
When adding an EventSource the startParam and endParam are sent automatically according to your current view on the calendar. Docs

Showing only ONE week (Opening hours, each week the same)

I would like to know if it is possible to show only one week, to use this calendar for showing opening hours of a shop.
So :
- I don't want to show the day dates (only the day names) : OK
- I don't want to colorize the current day : OK
- I want the calendar display always the same week => I don't know how to do that...
Have you got any idea ? Is it possible to do that ?
Thanks a lot !
If you use the "goToDate" method:
gotoDate
Moves the calendar to an arbitrary
year/month/date.
.fullCalendar( 'gotoDate', year [,
month, [ date ]] )
IMPORTANT: month is 0-based, meaning
January=0, February=1, etc.
you could add your shop opening hours on the calendar for a given date, and then just show the date. However, you could also just add them for the current week being shown - this would then allow you to change times, for example, bank holidays etc. Have an array of special dates and print normally if not one of those dates...
Since version 1.3 and 1.4 fullcalendar is now able to show week view:
http://arshaw.com/fullcalendar/docs/views/
http://arshaw.com/fullcalendar/docs/views/Available_Views/
Example:
http://arshaw.com/fullcalendar/views/agendaWeek/

Resources