[UPHPU] building a dynamic calendar

cole at colejoplin.com cole at colejoplin.com
Sat Mar 17 20:48:10 MDT 2007


Quoting Wade Preston Shearer <lists at wadeshearer.com>:

> I am building a calendar inside of a web application. Is there a way
> to determine how many days are in each month (February would be the
> only one that varies) and which day of the week it begins on without
> hard coding an array? Doesn't is vary from year? Is it something that
> is decided on by some committee or is it scientific (ie: could be
> determined with a formula)? My understanding is that it's fairly
> consistent from year to year but every once in a while it has to be
> tweaked with things such as leap years to make up for inconsistencies
> in the earth's rotation.

The %4&&!/100 is true. You can do this in any language, so it begs  
what your web app is written in. Or if it's in the browser, there are  
lots of those. Personally, I like Javascript pickers, because the  
calculations to build the calander are done on the client, not the  
server. Fine point, but I'll take it. From there, adjusting any js  
code to another language is fairly easy. If it's Flash, usually you  
can copy and paste the code directly without changes (again,  
calculations would be done on the client here too).

As for rotation, don't worry until the poles shift. Then you can kiss  
GPS, calendars, and lots of other things goodbye.

"In a polar region there is a continual deposition of ice, which is  
not symmetrically distributed about the pole. The earth's rotation  
acts on these asymmetrically deposited masses [of ice], and produces  
centrifugal momentum that is transmitted to the rigid crust of the  
earth. The constantly increasing centrifugal momentum produced in this  
way will, when it has reached a certain point, produce a movement of  
the earth's crust over the rest of the earth's body, and this will  
displace the polar regions toward the equator."

Albert Einstein




More information about the UPHPU mailing list