Date format issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Date format issue

el.ansari
Hi,

If you go to https://demo-trunk.ofbiz.apache.org/accounting/control/EditCustomTimePeriod you'll see that dates are shown in a specific format. For example : Jan 1, 2009.
Can someone tell me how to change this so that it's like in all the other screens ?
And besides, if you try to update a custom period you'll get the following error for example :




The Following Errors Occurred:

Type conversion of field [fromDate] to type [java.sql.Date] failed for value "Jan 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Jan 1, 2009" (java.text.ParseException: Unparseable date: "Jan 1, 2009")

Type conversion of field [thruDate] to type [java.sql.Date] failed for value "Apr 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Apr 1, 2009" (java.text.ParseException: Unparseable date: "Apr 1, 2009")
Thanks for your help,
el.abdesamad
Reply | Threaded
Open this post in threaded view
|

Re: Date format issue

Scott Gray-2
It's hard coded that way in the freemarker template EditCustomTimePeriod.ftl, changing it in there should fix the issue.  Ideally that whole screen should be converted to form widgets, I don't really see anything in there that requires freemarker.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 18/06/2010, at 10:35 PM, El Ansari Abdesamad wrote:

> Hi,
>
> If you go to https://demo-trunk.ofbiz.apache.org/accounting/control/EditCustomTimePeriod you'll see that dates are shown in a specific format. For example : Jan 1, 2009.
> Can someone tell me how to change this so that it's like in all the other screens ?
> And besides, if you try to update a custom period you'll get the following error for example :
>
>
>
>
> The Following Errors Occurred:
>
> Type conversion of field [fromDate] to type [java.sql.Date] failed for value "Jan 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Jan 1, 2009" (java.text.ParseException: Unparseable date: "Jan 1, 2009")
>
> Type conversion of field [thruDate] to type [java.sql.Date] failed for value "Apr 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Apr 1, 2009" (java.text.ParseException: Unparseable date: "Apr 1, 2009")
> Thanks for your help,
> el.abdesamad


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Date format issue

el.ansari
Thanks for ur quick answer... but I've not found where it's hard coded in the ftl.
I've found other ftl in the application with the same code but the dates are well displayed.

Thanks for ur help !
----- Mail Original -----
De: "Scott Gray" <[hidden email]>
À: [hidden email]
Envoyé: Vendredi 18 Juin 2010 11h45:46 (GMT) Auto-Detected
Objet: Re: Date format issue

It's hard coded that way in the freemarker template EditCustomTimePeriod.ftl, changing it in there should fix the issue.  Ideally that whole screen should be converted to form widgets, I don't really see anything in there that requires freemarker.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 18/06/2010, at 10:35 PM, El Ansari Abdesamad wrote:

> Hi,
>
> If you go to https://demo-trunk.ofbiz.apache.org/accounting/control/EditCustomTimePeriod you'll see that dates are shown in a specific format. For example : Jan 1, 2009.
> Can someone tell me how to change this so that it's like in all the other screens ?
> And besides, if you try to update a custom period you'll get the following error for example :
>
>
>
>
> The Following Errors Occurred:
>
> Type conversion of field [fromDate] to type [java.sql.Date] failed for value "Jan 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Jan 1, 2009" (java.text.ParseException: Unparseable date: "Jan 1, 2009")
>
> Type conversion of field [thruDate] to type [java.sql.Date] failed for value "Apr 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Apr 1, 2009" (java.text.ParseException: Unparseable date: "Apr 1, 2009")
> Thanks for your help,
> el.abdesamad

Reply | Threaded
Open this post in threaded view
|

Re: Date format issue

Scott Gray-2
Here's an example:
Line 115:
<input type="text" size='13' name="fromDate" value="${currentCustomTimePeriod.fromDate?string("yyyy-MM-dd")}"<#if hasntStarted> class="alert"</#if> />

Regards
Scott

On 19/06/2010, at 2:51 AM, El Ansari Abdesamad wrote:

> Thanks for ur quick answer... but I've not found where it's hard coded in the ftl.
> I've found other ftl in the application with the same code but the dates are well displayed.
>
> Thanks for ur help !
> ----- Mail Original -----
> De: "Scott Gray" <[hidden email]>
> À: [hidden email]
> Envoyé: Vendredi 18 Juin 2010 11h45:46 (GMT) Auto-Detected
> Objet: Re: Date format issue
>
> It's hard coded that way in the freemarker template EditCustomTimePeriod.ftl, changing it in there should fix the issue.  Ideally that whole screen should be converted to form widgets, I don't really see anything in there that requires freemarker.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 18/06/2010, at 10:35 PM, El Ansari Abdesamad wrote:
>
>> Hi,
>>
>> If you go to https://demo-trunk.ofbiz.apache.org/accounting/control/EditCustomTimePeriod you'll see that dates are shown in a specific format. For example : Jan 1, 2009.
>> Can someone tell me how to change this so that it's like in all the other screens ?
>> And besides, if you try to update a custom period you'll get the following error for example :
>>
>>
>>
>>
>> The Following Errors Occurred:
>>
>> Type conversion of field [fromDate] to type [java.sql.Date] failed for value "Jan 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Jan 1, 2009" (java.text.ParseException: Unparseable date: "Jan 1, 2009")
>>
>> Type conversion of field [thruDate] to type [java.sql.Date] failed for value "Apr 1, 2009": org.ofbiz.base.util.GeneralException: java.text.ParseException: Unparseable date: "Apr 1, 2009" (java.text.ParseException: Unparseable date: "Apr 1, 2009")
>> Thanks for your help,
>> el.abdesamad
>


smime.p7s (3K) Download Attachment