Jump to content

Navigating an event calendar...


CavemanUK

Recommended Posts

hi,

 

I have a calendar up and running that shows my itinerary for a given date... i dont know if its the correct way to do it but basically if no argument is passed to it, it shows todays events.  or i can pass a date to it (eg.. calendar.php?DisplayDate=2008-02-21)..

 

I would like to put navigation on the page so i can move forward or backwards a day but i havent a clue how i would make it work?  is there an easy calculation that would that the date value and add/remove a day from it and would it be good practice for it to simply reload the page with the new argument?

 

also, Im using a table for displaying the events.. is it possible to make the <td> cells clickable so i cant make it interactive? 

 

Thanks guys

 

CavemanUK

Link to comment
https://forums.phpfreaks.com/topic/106670-navigating-an-event-calendar/
Share on other sites

Those functions look exactly like what i need.. i was wondering how to format the date to pass to them...

 

eg..  the date i have is in a string passed from the argument (eg. "2008-02-21")..so in code it its like...

 

$mydate = "2008-02-21";  // obviously this is normally pulled from the argument

$dayafter = date(DateAdd("d",1,$mydate));
$daybefore = date(DateSubtract("d",1,$mydate)); // Sorry was wrong before

 

but it doesnt seem to work correctly and returns completely the wrong date... im probably passing the wrong date info but i don't understand what im doing wrong.

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.