Localisation Bug and work around.

This forum is for questions and issues arising from the use of AbleCommerce 7.0 outside the United States. International purchases of AbleCommerce 7.0 are way up. Thank you!
Post Reply
robgrigg
Lieutenant (LT)
Lieutenant (LT)
Posts: 76
Joined: Fri Jun 12, 2009 2:22 am

Localisation Bug and work around.

Post by robgrigg » Sat May 22, 2010 4:16 am

Hi,

I am using 7.0.4 in the UK. I have set the Local in my web config to en-GB

Code: Select all

<globalization culture="en-GB" uiCulture="en-GB"/>
This works but causes an issue in the admin order summary page with the Date Quick Pick drop down.

On the page some code writes out some JavaScript which sets the dates oin the DatePicker control.
After some investigating I realised that the DatePicker Control is not ASP.NET globalisation aware how ever the code which writes out the dates into the javaScript is.

If you look in Admin/Orders/Default.aspx you will see the method private void InitDateQuickPick()

This is using the globalisation aware format of "d".

Code: Select all

js.Append(string.Format(setStart, LocaleHelper.LocalNow.ToString("d")));
In the UK local this will format a date as dd/mm/yyyy. Unfortunaitly the DatePicker requires a US format Date of mm/dd/yyyy.

Idealy we would use a DatePicker which was properly coded to accept globalised dates, however as this is not going to happen in the near future, you can get round this by changing the date formatting to force a US date in the javaScript.

Code: Select all

js.Append(string.Format(setStart, LocaleHelper.LocalNow.ToString("MM/dd/yyyy")));
I hope this helps someone.

Rob.

Post Reply