My greyhound can run faster than your honor student.

Wednesday, November 26, 2003

Because I am a world class procrastinator, I just wrote a new function for my birthday page that lets me easily toggle back and forth from showing a person's age by either years or months.

So look at April 10. Instead of .4 years until Baby K. arrives, it now says 4.5 months. And Ensley R. is now 1.9 months old rather than 0.2 years old.

Once they are over 12 to 18 months I can just change which function I use to calculate their age, and it will then show up as years.

One of these days when I really feel like procrastinating, I will combine all of that into a single function that will calculate months if the age is less than 18 months, otherwise it will show years. I could even write an über-function that I could use for birthdays, anniversaries, etc. I would have to add an extra argument that indicates which type of event it is: "b" for birthday, "a" for anniversary; etc. It would then put the correct text after the data calculation. (i.e. " years old", "married for…", etc.)

No comments: