realbasic-nug
[Top] [All Lists]

Re: needed for Zymail: a constrained date formatter

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: needed for Zymail: a constrained date formatter
From: Joe Strout <joe at inspiringapps dot com>
Date: Fri, 30 Nov 2007 22:27:40 -0700
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <301886FD-8006-4C0A-8B3E-6297D15426B6 at alacatialabs dot com> <841DE13F-02D7-4F57-A6BC-A54DE43D98A7 at inspiringapps dot com>
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>


<Prev in Thread] Current Thread [Next in Thread>