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 protected]> wrote:
> From: David Avendasora <[email protected]>
> Subject: Re: Wonder update #231
> To: "Theodore Petrosky" <[email protected]>
> Cc: [email protected]
> 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 protected])
> > Help/Unsubscribe/Update your Subscription:
> > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
> >
> > This email sent to [email protected]
> >
> >
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]