yogabasics Posted February 3, 2010 Share Posted February 3, 2010 I modified this code that I found elsewhere and it works unless it is at the end of the month. At the end of the month if you click on a day that is in the next month things get all screwy. I also need to know how to make the days of the week always code to future dates and I think that would fix the problems that happen at the end of the month. Here is the code: <?php $cal_url = 'http://www.mywebsite.com/yoga-classes?calendar=2&category=0&d='; $wd_arr = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); $monday = mktime(0, 0, 0, // hour, minute, second (int)date('m'), // month (int)date('d')+(1-(int)date('w')), // day (can be negative!) (int)date('Y')); // year for ($n=0; $n<7; $n++) { echo "<a href='$cal_url", date('d', $monday+$n*60*60*24), "&m=", date(m), "&Y=", date(Y), "'>", $wd_arr[$n], "</a> "; } ?> Link to comment https://forums.phpfreaks.com/topic/190838-calendar-code/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.