Musachy Barroso wrote:
On 6/5/07, Allen Gilliland <[EMAIL PROTECTED]> wrote:

I am just using the default settings ...

<s:datetimepicker name="bean.dateString" />

when the form is submitted i see that there are actually 2 values
submitted, the dojo.bean.dateString and bean.dateString.  the format for
dojo.bean.dateString is RFC 3339 and the format of bean.dateString is
DateFormat.SHORT (mm/dd/yy).


That's the bug you mentioned earlier, the value in
dojo.bean.dateStringshould be the text that is entered on the date
picker(which is ignored by
S2), and the one in bean.dateString should be the RFC, but they are switched
:(



i am assuming that when the datetimepicker is being initialized from an
existing value it has to be looking at the value of bean.dateString,
which if i select today has a value of "6/5/07".  perhaps it's not
properly converting that display date into the RFC 3339 value it uses
internally?


When the date picker gets the value from the stack, if it isn't a Date
object, it will try to parse it using the value of the displayFormat, and
then format it to RFC (Dojo wants it in RFC). If the value cannot be parsed
then it will be passed to Dojo as is. That's why I suggested to use RFC
3339.

On 2.1 the datepicker will be able to use Calendar, Date and String fields
(different formats will be used to try to parse from the String,
SimpleDateFormat.*, RFC 3399, and displayFormat)

//I almost sound like I'm trying to sell 2.1 :)

I wish it was already out so that I could use it.

In any case, it sounds like there are a number of bugs with the current datetimepicker so I think I'll find an alternative solution until 2.1 comes out and the bugs are worked out.

Thanks for the explanation.

-- Allen



musachy


-- Allen


Musachy Barroso wrote:
> What is the format of the date in the string? If you stick to RFC 3339
it
> should be fine : yyyy-MM-dd (this is just the value, the display format
can
> be set using the "displayFormat" attribute)
>
> musachy
>
> On 6/5/07, Allen Gilliland <[EMAIL PROTECTED]> wrote:
>>
>> I'm having a problem with the datetimepicker where it always thinks the
>> year is 1907 when it gets loaded from an existing value.  I have only
>> been able to find this thread on the issue which suggests there is a
bug
>> but doesn't really provide any real work around ...
>>
>> http://www.mail-archive.com/user@struts.apache.org/msg61093.html
>>
>> I am using a String to store the value from the date picker as
suggested
>> by the last message in the thread but I am still getting the same
>> behavior.
>>
>> Is there any solution or work around to this problem using struts 2.0.6
?
>>
>> -- Allen
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to