PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 12th, 2008, 11:46 AM
Pabs Pabs is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Canada
Posts: 100 Pabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 52 m 22 sec
Reputation Power: 2
Get current week..

I have an events calendar.. if there's an event on a particular date , that date gets highlighted on the calendar and when the user clicks it...it load the event for that day...

is there an easy way for showing all events for that week? ...so with a know date (could be any day of the week) I want to display all the events happening starting the Sunday before it to the Sunday after it...

to display the contents of the entire month is easy enough since I know the month I'm on for that event...simple query at that point. but not sure if there's a built in mechanism to know what week of the month I'm on to be able to dump that in my query


thanks

Reply With Quote
  #2  
Old May 12th, 2008, 12:38 PM
hermawan's Avatar
hermawan hermawan is offline
Superman is not dead
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Jakarta, Indonesia
Posts: 552 hermawan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 21 m 55 sec
Reputation Power: 2
Send a message via ICQ to hermawan Send a message via AIM to hermawan Send a message via Yahoo to hermawan Send a message via Google Talk to hermawan Send a message via Skype to hermawan
You could use
Code:
date("N", timestamp)
to find the number of day.
1 = Monday, 2 = Tuesday, etc.. 7 = Sunday. After you got that number, I'm sure you know how to get the last Sunday of the given date.
__________________
Hermawan Haryanto
Web Consultant

Reply With Quote
  #3  
Old May 12th, 2008, 12:50 PM
Pabs Pabs is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Canada
Posts: 100 Pabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 52 m 22 sec
Reputation Power: 2
bingo...that was easy.... thanks!

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Get current week..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway