I'm using FullCalendar and it works perfect(ish) :)
Now my users are demanding a simple way to copy a full months of scheduled shifts to the next month - or any month.
I already have a "Copy week" function in place and it works fine. But I simply can't figure out the correct way to copy an entire months shifts. I was thinking to copy "day N Month A" to "day N Month B" but this leads to failure - as the 1. day in the month is constantly moving.
Any ideas how to accomplish this?
Edit:
The task I'm looking for input on, is really in the PHP/MySQL backend. In the frontend the user simply have 2 selects: Copy month to and a button "Copy".
In the backend I receive "mthfrom=>2014-1" and "mthto=>2015-1". I have no problem finding all events from 2014-1 with SELECT * from dbevent WHERE year(shiftstart)='2014' and MONTH(shiftstart)='1';.
The problem is that I need to "match" the correct workingdays, so the corresponding weekdays match up in the month copied to. E.g. I want to copy all shifts from January 2014 to March 2014.
- How to make sure that the monday shifts ends up on the correct weekday?
- How to make sure that no shifts end up on saturday/sunday?
- What to do if a user wants to copy a month with 28 days to a month with 31 days or vice/versa?