Re: Wonder update #231
Re: Wonder update #231
- Subject: Re: Wonder update #231
- From: Chuck Hill <email@hidden>
- Date: Sun, 27 Feb 2011 13:14:25 -0800
The problem here is that the calendar.js needs a pattern to work with, not a formatter. I think you would need to create a SimpleDateFormat sub-class that wraps the Joda formatter and implements the toPattern() to return the pattern from the Joda formatter using the format symbols from SimpleDateFormat.
Chuck
On Feb 27, 2011, at 12:43 PM, Theodore Petrosky wrote:
> except here is the 'awake' from AjaxDatePicker:
>
> public void awake() {
> super.awake();
>
> if ( ! (hasBinding("formatter") || hasBinding("format"))) {
> format = "%m %d %Y"; // Default
> formatter = new NSTimestampFormatter(format);
> }
> else if (hasBinding("formatter")) {
> formatter = (Format) valueForBinding("formatter");
> if (formatter instanceof NSTimestampFormatter) {
> format = translateSimpleDateFormatSymbols(((NSTimestampFormatter)formatter).pattern());
> }
> else if (formatter instanceof SimpleDateFormat) {
> format = ((SimpleDateFormat)formatter).toPattern();
> }
> else {
> throw new RuntimeException("Can't handle formatter of class " + formatter.getClass().getCanonicalName());
> }
> }
> else {
> format = (String) valueForBinding("format");
> formatter = new NSTimestampFormatter(format);
> }
>
> format = translateSimpleDateFormatSymbols(format);
> }
>
> If I read this correctly, if I bind formatter='some formatter', it is either an NSTimestampFormatter or a SimpleDateFormat or throw an exception.
>
> I was never able to successfully use JodaDate with the AjaxDatePicker. Either I am doing something wrong, or someone needs to open a Jira. I just assumed I was not doing it correctly.
>
> Ted
>
>
> --- On Sun, 2/27/11, David Avendasora <email@hidden> wrote:
>
>> From: David Avendasora <email@hidden>
>> Subject: Re: Wonder update #231
>> To: "Theodore Petrosky" <email@hidden>
>> Cc: email@hidden
>> Date: Sunday, February 27, 2011, 8:40 AM
>> Hi Ted,
>>
>> I believe the "formatter" binding is what you are looking
>> for. You can bind an instance of anything that extends
>> java.text.Format, which the Joda formatters do.
>>
>> Note that this is different than the "format" binding,
>> which just takes a string.
>>
>> Dave
>>
>> On Feb 27, 2011, at 6:10 AM, Theodore Petrosky wrote:
>>
>>> I see that there is a Wonder update (#231) on Hudson.
>>>
>>> WONDER-665: Joda DateTime prototype should be
>> timestamp instead of timestamptz for postgres
>>> http://issues.objectstyle.org/jira/browse/WONDER-665
>>> Reverted prototype to timestamp instead of timestamptz
>> (detail)
>>>
>>> I did the svn up and I see:
>>>
>>>
>>>
>> Frameworks/Core/ERPrototypes/Resources/erprototypes.eomodeld/EOJDBCPostgresqlPrototypes.plist
>>> A
>> Frameworks/Core/ERExtensions/Sources/er/extensions/formatters/ERXJodaLocalDateTimeFormatter.java
>>> A
>> Frameworks/Core/ERExtensions/Sources/er/extensions/formatters/ERXJodaLocalDateFormatter.java
>>> A
>> Frameworks/Core/ERExtensions/Sources/er/extensions/formatters/ERXJodaLocalTimeFormatter.java
>>> A
>> Frameworks/Core/ERExtensions/Sources/er/extensions/formatters/ERXJodaDateTimeFormatter.java
>>> U
>> Frameworks/Core/ERExtensions/Sources/er/extensions/migration/ERXMigrationTable.java
>>>
>>> ERXJodaLocalDateFormatter.java is interesting.
>>>
>>> Is there a way to use this formatter in an
>> AjaxDatePicker? If I read the source correctly, the ADP is
>> expecting and using NSTimestampFormatter (which of course
>> does not play well with JodaTime).
>>>
>>> Is there a way to use this formatter in an ADP?
>>>
>>> Ted
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be
>> ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>>
>>>
>>
>>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden