Jump to content

Calendar


CNT
 Share

Recommended Posts

http://members.toast...nt/calendar.jpg This (link above) is my plan and layout for my website calendar (one whole page, 1280x1024?). There may be some day(s) with events, so square(s) would be colored. Suppose two or more events at same day, different color. Something like that. Then if someone wants to see the schedule for the day, a chick (or double-click. or mouse-hover) will list the day's schedule. If I did it in PHP, the browser would create long history records. If I did it in Javascript, the target people that would go to my website would have their Javascript turn off (disabled) in their browser. How about HTML calendar? How/where to pull the date/time (from server or hardcode the date?). Any suggestions or how do I do about this? I can start with year 2010 and forward. What I am really asking is how should this calendar be programmed. I just don't want to code it one way and then doesn't work with MySQL or something. I did a lot of Internet search and couldn't find much help (and somewhat more confused). I don't want to buy a calendar, I want to learn it! If you know of a link that could help me to start with the calendar (format as in above link), let me know. Thank you. Chuck
  • Like 2
Link to comment
Share on other sites

My guess is to use tables to do the month calendar boxes. Do I need to do a day counts for every month and then code to make tables according to the number of days in the month, plus need to figure out the number of weeks. Usually two months of a year has 5 weeks, so those months would have 5 rows. Is there a way to do the programming? I wish there was a website that guide how to create the calendar. On top of that, I need to somehow link the calendar to a MySQL database. The DB would have the events (some one-day, some few days together, and some weeks). Chuck

Link to comment
Share on other sites

You have to think of the rules you would use in your head when drawing a calendar on paper. 1. Find the weekday of the first day of the month.2. Start a row3. Print empty cells until the specified weekday.4. Print days until the end of the week5. Start a new row6. While there are still days left in this month, repeat steps 4 and 5

Link to comment
Share on other sites

So, I need to set a date in the code, like: January 1, 2000 is Saturday.Febuary 29, 2000 is the first leap year. Then I do the math. Would that make the webpage a drag? It would be adding up all those days to come up with the present date. I just thought there's a settings buildin the programming lauguages or computer/server that can be easily called. Time zone or daylight saving time shouldn't be any concern? If there's a code to pull the date, it will also be possible that the server having the wrong date/time (from virus or hacking)? I am just asking how do most people do calendar for a webpage, isn't there a common or "standard" way of doing this? www.time.gov ?

Link to comment
Share on other sites

I think you're looking too much into this. There's no built-in function to print out a calendar because different people would want different code to display the calendar. First select the month you want to represent, then use PHP's mktime() and date() functions, or Javascript's Date() object to figure out which weekday it is and start printing from there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...