From: Jim Freeze Date: 2006-12-12T09:33:55+09:00 Subject: Re: Suggestions for a date picker that supports mm/yyyy --Apple-Mail-2-745317172 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Dec 11, 2006, at 5:30 PM, Jason Vogel wrote: > Does anyone have some suggestions for a date picker that supports > mm/yyyy. > > Also, does anyone know the "best" way to validate a mm/yyyy as > "valid"? > Meaning this month or the future? Not sure exactly what validation you are doing with month and year. Maybe you mean mm/dd/yyyy? But, FYI, you can probably validate dates without too much effort since there are only 14 calendars. One for Jan 1 on each day of the week, and another similar seven calendars, except that the year is a leap year. Leap years are yyyy % 4 == 0. This tells you which of the two calendars to choose, assuming you know what day Jan 1 falls on. To get that, pick a starting point and see that Jan 1 moves forward one day for each year, and two days for the year following a leap year. 2000 - Sat 2001 - Mon 2002 - Tue 2003 - Wed 2004 - Thu 2005 - Sat 2006 - Sun 2007 - Mon HTH ... Jim Freeze --Apple-Mail-2-745317172--