fullcalendar wrong timespamp for midnight - fullcalendar

I am using fullcalendar.io and I realized that if I create a new event in the month view, dragging across one or more days, it returns a timestamp for the end date which is later rendered as 12 am of the day after while it should be logic that a function date("what-ever-format", timestamp) returns 12 pm of the current day, or, in any case, not the following day.
Any idea how to fix this???

Related

Manipulating data from sqlite database

Am a beginner in android development and i am designing an android app which takes input of a date and stores it in sqlite database. Could you please explain how i can retrieve the date and use it to calculate other dates which i will display in another activity
Eg if input is 1/1/2019, i need to calculate events that occur after this date and display them in order of events and the date
Event 1 - 12/01/2019
Event 2 - 2/02/2019
Event 3 - 26/02/2019
Event 1 occurs after like 21 days, event 2 occurs after like 24 days
How should i perform this calculation and display them in another activity?
The link mentioned above is correct. To put it simply just use SQLite's date function - it can calculate dates quite easily:
SELECT date('2019-01-12', '+21 days');
gives you 2019-02-02.
Instead of the date value use a column name of your table if approbiate.
Take the calculated date for the second event and add 24 days and SQLite gives you the date for the third event.
SELECT date('2019-02-02', '+24 days');
2019-02-26
Hint: my answer only deals with the database side (cause that's what your question is tagged with). I have no idea about the Android programming.

Fullcalendar - Display an event with no end date

How do I go about displaying a long-running event with no end date? The data provided to me only shows when the event started but no end date because it's set to "Forever". It appears that when I only provide the start option, it only sets the event to show up on that day and not the following days.
I have a possible workaround for this, where if there is no end date from the event source, I always set the end date to 24 months from today, but that means if someone navigate the calendar past 24 months, the event would appear to have ended then. Would be nice to have something that will just keep going forever.

Fullcalendar - event shows wrong end date by one day

I have training events from database and their start and end dates are in this format "YYYY-MM-DD". For example is:
{
'title':'English Training',
'start':'2015-05-19',
'end':'2015-05-23'
}
But when it is rendered in calendar, it shows wrong end date
I tried adding 12hours on endDate (*just like the answer * here) , and yes it works but now I'm unable to extend the day for an event.
I want to fix this wrong end date issue without losing the capability to extend events. Do you know any solution or hacks?
Adding 12 hours on the endDate of your event won't make it an allDay event anymore, which is why you will loose the ability to extend your event in month view.
However, adding 1 day on the endDate will work perfectly as :
Your event will remain an allDay event (so it will remain extendable)
Your endDate will become 2015-05-24 (understood by FullCalendar as 2015-05-24T00:00:00) which means that your event will end at the very first minute of 2015-05-24 which is what you want.
To conclude : if you want an allDay event to end at midnight of day1, you have to set its endDate as day2 !

Symfony 2 - Generate calendar month table with links to events in it

I have an Entity called Event, with fields startDate, startTime, endDate and endTime. startDate and endDate are dates of which endDate can be NULL if it is the same of startTime (I can change this behaviour if it makes things easier as I have no events yet). startTime and endTime can not be NULL. It also has an isOnDate(\DateTime $date) method, which returns true if the event will run on the given date.
It was like pain, but I finally generated an HTML table of any given calendar month, passing the day of week of the month's first day (firstDow) and the number of days in that month (numDays) as template variables.
The next step would be to make some table cells links to event or event listing pages if the given days has one or more events. Now I'm a bit stuck, as I don't know how to get the DateTime() object of each cell in a template.
Can someone give me a hint on this? Or am I making it totally wrong?
You can display DateTime Objects as Text Dates using Twig Filter date:
{{ event.startDate|date("m/d/Y") }}
You could use Ajax and jQuery to link dynamically your page with your database. You could start from this calendar code for Symfony2: http://www.symfocal.com

FullCalendar "Calendar" Month View Starting from Current Day

I have a need to use the FullCalendar plugin's month view, but with a small twist... I need the month view to be a calendar month (4 weeks) from the currently selected date, not a month proper (Jan, Feb, etc). In other words, I need the top left column to be the currently selected date, with the calendar rendering 4 weeks after that in month view.
Something similar to what is provided by thefirstDay property in agendaWeek view is close to what I am after. firstDay only sets the day of the week though, not a specific date within the month as the first day.
Try
firstDay: new Date().getDay()
in the parameters.
If you're going to show a Thursday in the upper left hand corner then what you've got isn't a calendar. It's a table data.
FullCalendar's firstDay is just for switching between starting on a Monday (European style) and starting on a Sunday (US style).

Resources