4.3 admin date format

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Hi,

How do you change the date format in the admin interface? I have changed the primary language to en-GB, but that has no effect, as dates still seem to be in the en-US format.

Thanks.
3 years ago
From what I can see, after changing the culture to en-GB  the date is displaying dd/mm/yyyy in form fields, but still in US mm/dd/yyyy in the datagrids.
3 years ago
Culprit =

  public partial class RenderDate : IRender
    {
        #region Constants

        /// <summary>
        /// Default date format
        /// </summary>
        private string DEFAULT_DATE_FORMAT = "MM/DD/YYYY HH:mm:ss";

        #endregion

        #region Ctor

        public RenderDate()
        {
            //set default values
            Format = DEFAULT_DATE_FORMAT;
        }


I guess I can hardcode the fix, but think it should be fixed properly... (or at least default to YYYY-MM-DD as that is acceptable across the world)...
3 years ago
Same issue here - I have hacked the Order List page in the Admin with

                            RenderDate rd = new RenderDate();
                            rd.Format = "DD/MM/YYYY HH:mm:ss";
                            gridModel.ColumnCollection.Add(new ColumnProperty(nameof(OrderModel.CreatedOn))
                            {
                                Title = T("Admin.Orders.Fields.CreatedOn").Text,
                                Width = "100",
                                Render = rd
                            }) ;

But it is a hack - there should be a way to manipulate this for all of the Admin suite without recompiling the code.
3 years ago
gosh this is gruesome, after all these years still not properly supporting date formats.

please fix NopCommerce - your product is almost fab, but let down by silly things like this.

You know how hard it is to explain to a client that "NOP is great, but...you have to live with wrong date formats" ??
3 years ago
And it's usually the first thing they notice!

miles wrote:
gosh this is gruesome, after all these years still not properly supporting date formats.

please fix NopCommerce - your product is almost fab, but let down by silly things like this.

You know how hard it is to explain to a client that "NOP is great, but...you have to live with wrong date formats" ??
3 years ago
did anyone have an idea or implemented date format on MM-DD-YYYY,
while importing anything in admin I need on this format "MM-DD-YYYY"

I have tried to change in propertyByName file this field
 public DateTime? DateTimeNullable => PropertyValue == null ? null : DateTime.FromOADate(DoubleValue) as DateTime?;

Try like this also when getting date from excel sheet
property.DateTimeNullable.ToString("MM-dd-yyyy")

but not luck ,
I had tried with different things , but it getting first date , month and year

are some have an idea regarding the same then answer
Thanks
3 years ago
See: https://github.com/nopSolutions/nopCommerce/issues/4777

For 4.3 I personally just changed the "DEFAULT_DATE_FORMAT" to be "EN-GB" format, but it might be worth trying the fix for 4.4 (so it is tested by the time it is released).

As for the need for recompiling the source, that is necessary, given all of the bugfixes and regularity  in https://github.com/nopSolutions/nopCommerce/tree/4.30-bug-fixes
3 years ago
Can you explain how to get to the DEFAULT_DATE_FORMAT to change it?
I am on my first installation and finding the US-focussed defaults difficult to change!

Thanks
3 years ago
Admin > Configuration > Languages

Remove what you don't need. I just have English (UK) in my list.  

To fix the data grids with wrong date format you will ALSO need to edit source code and recomplile as per previous messages in this thread.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.