How to change date format for Admin interface?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
I'm not sure is this still active.

I also have problem with it but I manage to correct it with:

1. Setting Globalization(true) to telerik ScriptRegistrar. Its inside _AdminLayout.cshtml in administration project.


    @(Html.Telerik().ScriptRegistrar()
            .jQuery(false)
            .jQueryValidation(false)
            .Globalization(true)
            )


2.
Next you need to change validation test from "(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)" to "(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)"

3. In global.asax I remove fixed culture setting

From
//always set culture to 'en-US'
//we set culture of admin area to 'en-US' because current implementation of Telerik grid
//doesn't work well in other cultures
//e.g., editing decimal value in russian culture
var culture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;

To
var workContext = EngineContext.Current.Resolve<IWorkContext>( );
if( workContext.CurrentCustomer != null && workContext.WorkingLanguage != null )
{
     var culture = new CultureInfo( workContext.WorkingLanguage.LanguageCulture );
     Thread.CurrentThread.CurrentCulture = culture;
     Thread.CurrentThread.CurrentUICulture = culture;
}


Remark. Its about decimal sign (not date). (I did not try date but It may also work for date).
11 years ago
Does anyone know if this problem has been fixed in the current version (2.65)?  Seems silly there is no official way to get the date format correct for the UK and we have to use American date format :(

Bubbi - do you know which file to change the validation test in?  Perhaps I don't need to change this for UK as we still use the dot (.) as the decimal separator and not a comma.
10 years ago
Was it fixed with nopCommerce 3.0? Where can i change it?

On Teleriks you can see, that there is no problem with culture format.
http://demos.telerik.com/aspnet-mvc/razor/grid/localization?theme=default&culture=de-DE

Languagefiles are installed and german is selected, but nothing happens to dates and decimal values.

Any solutions?
10 years ago
I am having this same problem - I need to localize dates/decimals in the backoffice and am unable to do it.
Is there a fix for version 3.0 ?
10 years ago
Dear nopCommerce team!

Could you please answer in this thread about non-US formats?

I am having same problem in Australia.

Thank you.

Ребята, я реально немогу найти нормального ответа на эти форматы.
Проясните пожалуйста.

Спасибо.
10 years ago
Hi Guys,

Since its really sticky issue to fix.

Did the trick as bubbi suggested. But interestingly, dd/mm/yyyy wasn't working for me. Luckily i figured out, validation fails only for chrome.

So, goolge came to rescue and found following workaround for chome based validation bug. This article has the problem explanation too.


http://www.codeproject.com/Tips/579279/Fixing-jQuery-non-US-Date-Validation-for-Chrome

So combine with bubi's fix and above fix, dd/mm/yyyy works ok.

Hope this helps someone. My fix is for nop v2.70
10 years ago
But I don't want to change core of NopCommerce.

I hoped there was a fix in Version 3.0.
10 years ago
Could nopCommerce please respond to this post? I also want to display numbers correctly according to locale in admin area.
10 years ago
Hi,

I'm still in the middle of my first implementation, so version 3 is my starting point. Given the age and maturity of the project I would hope not to be having to start to tinker with the base code to solve something as basic as this, though I acknowledge the difficulties that have already been documented here.

It seems like such a small thing to people who are seeing the dates the way they are used to, but to everyone else, it seems so alien, especially to users who can't understand why this is such a hard thing to fix. To me in the UK, my customers will think I am just being lazy or making excuses :(!

I have been watching this thread whilst getting on with what I need to do to get my site customised, and like the post a few minutes ago, I would like to add my voice to this request.

As I get to know the product, I hope I will be able to make contributions to its continual development, but in the meantime, will some kind sole please help with a solution that will work with version 3?

Thanks to everyone who has made it as great as it already is.

Steve
10 years ago
totally agree!

this seems to be an issue since 2011???

please vote for it:

https://nopcommerce.codeplex.com/workitem/10321
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.