Change date format?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
Is there a easy way to change the datef format? From MM/DD/YYYY to DD/MM/YYYY.

Thanks
14 years ago
i would like to know this also.

saludos
14 years ago
Other than implementing the ISO standard alternate language .. I can only assume that you're wanting to override how the en-US language (select * from nop_Language) implements dates.

It seems that you could easily add a new Locale String Resource:

insert into Nop_LocaleStringResource (LanguageID, ResourceName, ResourceValue)
values (7, 'Admin.GlobalSettings.Date.Format', 'dddd, dd MMMM yyyy')

and get that object wrapped so you could update where dates are used (the one I found was in the order form control of /Modules/OrderDetails.ascx.cs

            this.lblCreatedOn.Text = DateTimeHelper.ConvertToUserTime(order.CreatedOn).ToString("D");

You could change this to reflect the new locale string resource value or just manually alter it to be:

            this.lblCreatedOn.Text = DateTimeHelper.ConvertToUserTime(order.CreatedOn).ToString("dddd, dd MMMM yyyy");

Maybe that points you in the right direction.  Date handling should be added as a permanent addition to the locale string resource collections in future versions.  Been doing international tennis websites and we run into this all the time... not doing commerce sites for that yet so I haven't had to mash up NOP Commerce.

Thanks,

Jared Nielsen
www.FUZION.org
14 years ago
Go to your active language details page (admin area) and set its culture into to a culture which supports 'dd/mm/yyyy' (such as ru-Ru)
13 years ago
Was having trouble with a CompareValidator for date still wanting US dates after I'd changed the culture to en-GB as detailed above.

The solution was to include

using NopSolutions.NopCommerce.BusinessLogic.Localization;

On the page (well actually the new module I had built).

Page lacking this was Account.aspx. (v 1.4)

I was a bit supprised that this wasn't present on there?
12 years ago
a.m. wrote:
Go to your active language details page (admin area) and set its culture into to a culture which supports 'dd/mm/yyyy' (such as ru-Ru)


I'm using italian language, but in the top of admin area, the date format is "Tuesday, September 27, 2011 5:49 PM". Why?
12 years ago
domenico.neri wrote:
I'm using italian language, but in the top of admin area, the date format is "Tuesday, September 27, 2011 5:49 PM". Why?

For nopCommerce 2.X versions 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). You can find a hack here
12 years ago
The problem is not with Telerik components, but with the date / time string immediately above the header in the admin area.
12 years ago
domenico.neri wrote:
The problem is not with Telerik components, but with the date / time string immediately above the header in the admin area.

It's formatted according to the current UI culture which is always set to 'en-US' for admin area
12 years ago
Ok, thanks.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.