commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [beanutils] default converters for File and URL?
Date Fri, 11 Apr 2003 09:43:03 GMT
beanutils already has support for date conversions through the converters 
in the org.apache.commons.beanutils.locale.converters package.

the big argument in the past for not creating date converters in the main 
package has been that localization makes it hard for a non-localized class 
to do the right thing. having said that, it might be possible to create a 
non-localized solution which takes a calendar. good luck and it'll be 
interesting to see what you come up with!

- robert

On Thursday, April 10, 2003, at 08:47 PM, EPugh@upstate.com wrote:

> I just wanted to let you know that the desire to handle Date's seem pretty
> popular!  There are two other recent posts under [betwixt] of people 
> asking
> for a converter for java.util.Date's.  Mine is under the subject: RE:
> [betwixt] Strategies for roundtripping Date objects
>
> In the short term, I have string's that look like this: Thu Apr 10 14:55:
> 44
> EDT 2003, which is what is produced by doing a Date.toString().  If I just
> register my own converter, would that be picked up by betwixt
> (theorectically)?
>
> When you get the DateConverter made, I'll be happy to integrate it into
> Betwixt with the approrpate tests.
>
> Eric Pugh
>
>
>
> -----Original Message-----
> From: Eric Pabst [mailto:ericpabst@netzero.net]
> Sent: Monday, April 07, 2003 9:52 PM
> To: commons-dev@jakarta.apache.org
> Subject: Re: [beanutils] default converters for File and URL?
>
>
> So once a DateConverter is made, is the 'proper' way to handle the
> "YY/DD/MM" style thing to have a custom Locale? Or should I pursue the
> idea of optional arguments being settable on converters?
>
>
>
> It would be nice to have the DateConverter handle parsing multiple
> DateFormat's, although it can of course have only one default format when
> formatting.  The DateConverter could have a method:
>     List getDateFormats()
> which would be a "live" List and allow the caller to add to, remove from,
> clear, re-order, etc. the List.  Each DateFormat should probably have
> isLenient false in order for the DateConverter to try the next one if it 
> is
> not the exact format.  Order is very important between similar formats,
> especially when no delimiters are involved, such as: MMDDYY and YYYYMMDD.
>
> Eric Pabst


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message