From: Kris Leech Date: 2006-06-20T22:10:00+09:00 Subject: Converting a date to the day of the week ------=_NextPart_000_000A_01C69472.F4FAD660 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/classes/Date.html#M000370= Looking at the Date class there are two constants, a hash DAYS and an = array ABBR_DAYNAMES.=20 DAYS =3D { 'sunday' =3D> 0, 'monday' =3D> 1, 'tuesday' =3D> 2, = 'wednesday'=3D> 3, 'thursday' =3D> 4, 'friday' =3D> 5, 'saturday' =3D> 6 = } ABBR_DAYNAMES =3D %w(Sun Mon Tue Wed Thu Fri Sat) I can get the integer for the day 'number' (0 to 6) from a date using = the wday method, ie. Date.today.wday But how do I use the array or hash from Date.rb, it does not appear to = be initialized at the time of use. Ultimately what I wish to create is a select box (monday-sunday) with = today's day pre-selected. I've looked for a Rails helper to this but there does not appear to be = one. Many thanks. AFM. ------=_NextPart_000_000A_01C69472.F4FAD660--