cruxaders Posted March 29, 2011 Share Posted March 29, 2011 my problem is if my local date is february 1 or march 30... if i press previous month i cant see the month of february, but if i press the change the local date to february 2 or march 29 i can see the month of february in my event calendar... what should i do to see the month of february even i set the local date in february 1 or march 30.... heres the code if (isset($_GET['day'])){ $day = $_GET['day']; } else { $day = date("j"); } if(isset($_GET['month'])){ $month = $_GET['month']; } else { $month = date("n"); } if(isset($_GET['year'])){ $year = $_GET['year']; }else{ $year = date("Y"); } $currentTimeStamp = strtotime( "$day-$month-$year"); $monthName = date("F", $currentTimeStamp); $numDays = date("t", $currentTimeStamp); Quote Link to comment https://forums.phpfreaks.com/topic/232088-i-got-a-problem-on-my-month-event-calendar/ Share on other sites More sharing options...
Psycho Posted March 29, 2011 Share Posted March 29, 2011 The problem is likely in the code you use to create the "previous" link. You need to validate that you are passing the expected values. Also, I wouldn't use dd-mm-yyyy with strtotime(). I believe the standard would be mm-dd-yyyy. But, to be safe just use yyyy-mm-dd. Quote Link to comment https://forums.phpfreaks.com/topic/232088-i-got-a-problem-on-my-month-event-calendar/#findComment-1193928 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.