Click to See Complete Forum and Search --> : PHP Calendar


ihafarm
12-03-2001, 09:34 PM
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

Grizzly
12-03-2001, 09:54 PM
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/

ihafarm
12-03-2001, 10:09 PM
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

Grizzly
12-03-2001, 10:17 PM
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).]

ihafarm
12-03-2001, 11:35 PM
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).]

Grizzly
12-04-2001, 12:04 AM
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.

ihafarm
12-04-2001, 12:28 AM
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

e_dawg
12-23-2001, 07:57 AM
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).]

Grizzly
12-23-2001, 09:05 AM
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 http://www.sharkyforums.com/ubb/biggrin.gif 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/

e_dawg
12-23-2001, 05:48 PM
Thanks! http://www.sharkyforums.com/ubb/smile.gif

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