View Full Version : Wrong Default Month and Year
froye001
09-18-2009, 03:11 PM
My calendar does not default to the current month, day and year.
When you first land on the calendar page, it displays "January 2009" (2009 happens to be the Year Selection Start entered in the setup.
When you click the "Today" button, the calendar displays "January 2009" but the url ends with "mo=09&yr=0000"
When you click to advance a month, the calendar shows "February 2009" and the url ends with "mo=2&yr=2009"
At no point does the current day highlight even though Highlight Today is selected in the setup.
Brian
09-18-2009, 03:19 PM
Can you provide a link to the page with the issue?
froye001
09-18-2009, 04:03 PM
http://www.confucius.umn.edu/calendar/index_cal_test
Brian
09-18-2009, 05:19 PM
Haven't seen this before... If no date is specified, the calendar uses the PHP date function to tell it what the current month/year to display.
Did it do this from the very first time it was installed or did it happen later?
froye001
09-18-2009, 05:27 PM
Did it from the very start.
It behaved the same way on our test server which didn't concern me because that server has all kinds of junk on it. But this is on our live server which is pretty clean.
What can I give you to help trouble-shoot? PHP and Apache version info?
Is there code I could insert temporarily to get this calendar launched? Explicitly set the default month and year maybe?
Brian
09-18-2009, 05:42 PM
You can set the $mo variable to 9 ($mo=9;), but then you can't change the month. PHP should be reporting the correct month to the calendar, but it isn't or someone modified part of the calendar code that changed how this works.
Can you open a support ticket and attach your calendar/calendar.php file?
froye001
09-18-2009, 06:13 PM
Ticket: QLS-569520
I hacked it! I added:
if($_REQUEST['mo'] == '') { $mo = 9; }
if($_REQUEST['yr'] == '' || $_REQUEST['yr'] == '0000') { $yr = 2009; }
$TOC=1;
require ("../cal/calendar.php");
which buys us a little time.
I'm going to make a version live then return the test page referenced above to it's broken state. Thanks for all your help.
ve9gra
09-18-2009, 10:22 PM
Before you do that, try to echo out $mo in case your site somehow uses that variable somewhere. That could account for reset to 1... but I'm not sure it would explain you being able to then navigate from that point.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.