The code works well; the only hitch is that none of the date formats
(LongDate, AbbreviatedDate, or ShortDate) match what Mail displays.
Our LongDate includes the day of the week: "Friday, November 30,
2007". The next shortest is AbbreviatedDate, which leaves out the
day of the week but also abbreviates the month: "Nov 30, 2007".
Mail uses an in-between format with the full month name, but no day
of week: "November 30, 2007".
This is surprisingly difficult to do in RB. The Date class doesn't
have a method to give you the month name as a string, and I can't
think of any particularly elegant way to get it from the system.
It's probably included in the LongDate, but since the format of the
LongDate may vary based on user preferences, how would I know which
word to grab?
Hmm... I suppose I could construct two dates, the first and second of
the month, and then look at their LongDates for the word that does
not change and is not a number. Hardly elegant, but it'd do the
job. Anybody have a better idea?
(Not that this is particularly important, but it's fun that already
this project is turning up some real-world issues in RB.)
Best,
- Joe
--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|