Created
July 31, 2011 17:13
-
-
Save codecowboy/1116979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.fc-day-number').each(function(){ | |
lDay = parseInt($(this).text()); | |
//check if it is another month date | |
if($(this).parents('td').hasClass('fc-other-month')) | |
{ | |
lYear = parseInt(cYear); | |
//if it is belong to the previous month | |
if(lDay>15) | |
{ | |
lMonth = parseInt(cMonth) - 1; | |
lDate = new Date(lYear,lMonth,lDay,12,00,00,00); | |
dateArr.push(lDate); | |
} | |
else //belong to the next month | |
{ | |
lMonth = parseInt(cMonth) + 1; | |
lDate = new Date(lYear,lMonth,lDay,12,00,00,00); | |
dateArr.push(lDate); | |
} | |
} | |
else | |
{ | |
lMonth = parseInt(cMonth); | |
lDate = new Date(lYear,lMonth,lDay,12,00,00,00); | |
dateArr.push(lDate); | |
} | |
}); |
Thanks for getting back to me - I figured it out in the end but that adds a bit more context.
Thanks again
Luke
…Sent from my iPhone 4
On 1 Aug 2011, at 18:38, ***@***.*** wrote:
I believe the reason for this is because the calendar object stores a max of the first two weeks for the next month (which can be a max of 14 days on a Feb that starts on Sun) on the Actual display page. This changes each time the viewDisplay is called (http://arshaw.com/fullcalendar/docs/display/viewDisplay/)
Since you may see up to day 14 for the next month, anything 15 and over (I guess the code should reflect that!) must be for the previous month
Hope that helps,
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1116979
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe the reason for this is because the calendar object stores a max of the first two weeks for the next month (which can be a max of 14 days on a Feb that starts on Sun) on the Actual display page. This changes each time the viewDisplay is called (http://arshaw.com/fullcalendar/docs/display/viewDisplay/)
Since you may see up to day 14 for the next month, anything 15 and over (I guess the code should reflect that!) must be for the previous month
Hope that helps,