PHP Calendar

Sharky Forums


Results 1 to 10 of 10

Thread: PHP Calendar

  1. #1
    Expensive Sushi
    Join Date
    Dec 2000
    Posts
    30

    Post PHP Calendar

    I am working on a project that requires a calendar, one that allows you to view month/week/day...a week being Sun - Sat. So, if the first day of the month starts on Wed, the first week of the month that would be displayed would go from Wed - Sat. and if the last day of the month was not Sat, on the week view it would display Sun - last day. Hope I explained that well enough. I have the month view and the day view done, wasn't aware that I needed week view until today, I have a number of options on how to accomplish this, was just looking for input.

    -Michael

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    One night I got bored, so I actually made a PHP Calendar similiar to what you're describing. I didn't entirely follow your message, but take a look at my calendar and let me know if it will be at all helpful for your "week" view. If it will, I'd be glad to send you the source.
    http://grizz.dhs.org:81/calendar/

  3. #3
    Expensive Sushi
    Join Date
    Dec 2000
    Posts
    30

    Post

    You have what I described as a month view. I currently have month view and day view, each allow movement across months and years. My trouble lies in the week view...let me see if I can explain it better this time. When you go to week view, it should show you one week out of the month, I will refer to Dec 2001 of your calendar for clarity. That month has 6 "weeks" in that there are 6 rows...duh, it's late. In week view for Dec 2001 the first week should simpy show you Sat Dec 1. 2nd week should show you 2-8, etc to the last week that should show you 30-31.

    BTW...your calendar is MUCH prettier than mine.

    -Michael

  4. #4
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    Ahhh I see. Yeah my script doesn't currently support a week view, but I could give it a week view if I did a 5 minute code tweak. I'm at work right now, but I'll try and show you a "week" view as soon as possible.



    [This message has been edited by Grizzly (edited December 03, 2001).]

  5. #5
    Expensive Sushi
    Join Date
    Dec 2000
    Posts
    30

    Post

    Thanks for the offer, but I prefer to do my own coding, I was just asking for ideas...

    Well, hell, I guess that shows my inexperience, any help would be appreciated. I just don't want to rip anyones code, my current idea for getting this function to work requires much convoluted coding...
    -Michael

    [This message has been edited by ihafarm (edited December 03, 2001).]

  6. #6
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    Ah okay. I respect your desire to code it yourself, I always feel the same. Unfortunately I don't have time tonight to do this anyways, I really need to get to bed. Perhaps tommorow I can write up a little guidance as to how I would attack it.

    PHP's date() function makes this a very simple problem.

  7. #7
    Expensive Sushi
    Join Date
    Dec 2000
    Posts
    30

    Post

    Hahaha. I wish I had looked at the date() function BEFORE I started all this. I ended up doing much of what it can do on my own...Having looked at it now I believe I can code a week function.

    Damn. Thank you.

    -Michael

  8. #8
    Hammerhead Shark e_dawg's Avatar
    Join Date
    Jan 2001
    Location
    Earth, Western Hemisphere, North America, US, UT, SLC
    Posts
    2,628

    Post

    That looks really nice...

    If you're offering, I'd love to use the code for the calendar -- not having to write that portion of the code would save me quite a bit of time on one of my volunteer projects... (I need to quit collecting these)

    [This message has been edited by e_dawg (edited December 23, 2001).]

  9. #9
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    Hey sure thing. I never really cleaned up the code too much. I just kind of made the thing as a "proof of concept" for myself one evening. It would probably be best to put a majority if the data crunching into a function or a class method. But I'll leave that up to you Do with it what you will. If you do end up putting it to good use, definitely send me a link. I love seeing stuff I've made put to use. Enjoy!


    http://grizz.dhs.org:81/calendar/download/


  10. #10
    Hammerhead Shark e_dawg's Avatar
    Join Date
    Jan 2001
    Location
    Earth, Western Hemisphere, North America, US, UT, SLC
    Posts
    2,628

    Post

    Thanks!

    I'll play with it sometime next week... so I can add all the scheduling junk and clean it as needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •