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.
8 years ago
Is there any solution to this available yet? There must be a solution where we could just use default currency and date/time format among other things...

Or do we still suffer because of Telerik bug?
8 years ago
https://nopcommerce.codeplex.com/workitem/12013 is still active so it "may" come in 3.60. However don't hold your breath. If it doesn't, you can either implement the work around I have stated on the previous page or try the bits in the work item...
8 years ago
Example of a tough method that I apply

Nop.Admin.Models.Customers.CustomerModel


[UIHint("DateNullable")]
[DisplayFormat(DataFormatString = "{0:dd-MM-yyyy}", ApplyFormatInEditMode = true)]
[NopResourceDisplayName("Admin.Customers.Customers.Fields.DateOfBirth")]
public DateTime? DateOfBirth { get; set; }
8 years ago
I just revisited this annoying problem, in the hope that we would have a solution by now. My research led me to this link - http://stackoverflow.com/questions/11625237/kendo-datepicker-fails-validation-for-custom-date-format - which, if I understand the whole issue correctly, is more widespread than just nopCommerce.

Does anything in this thread help reach a fix for an out-of-box solution?
7 years ago
I found one solution:
1. Look for the kendo js file getting loaded for the page. It may be general or culture specific.
In my case it was general located at :
<local-dir>\Nop.Web\Administration\Scripts\kendo\2014.1.318\kendo.web.min.js

Change the dateformat in the js file directly.

It worked for me, I hope it works for you as well.
6 years ago
Hi, from what I can see 3.9 still has the same Admin UI culture issue and using old kendo ui v.2014.1.318.. Are there plans to replace kendo ui or upgrade?
Thanks
Pavel
6 years ago
Btw, anyone found a fix for it.. I've tried all the solutions from this thread but getting validation errors on dates now and datepicker sets date in US format anyways. Date validation error shown for any date now e.g. 6/6/2017..
All I need is en-GB.
Thanks
Pavel
6 years ago
Editors need to be modified along with the suggestions in this thread then dates appear to work fine

https://www.nopcommerce.com/boards/t/44510/date-format-in-admin-area.aspx#188597

@model DateTime?
@using System.Globalization

<input id="@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)" name="@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)" value="@(Model > DateTime.MinValue || Model.HasValue ? Model.Value.ToString(CultureInfo.CurrentCulture.DateTimeFormat) : null)" />
<script>
    $(document).ready(function () {
        $("#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)").kendoDateTimePicker({
            popup: {
                position: "bottom right",
                origin: "top right"
            },
            format: "dd/MM/yyyy HH:mm"
        });
    });
</script>
6 years ago
Change in Kendo.web.min.js from en-US to en-GB, what else changes require other than below? in this thread so many options are told can you please elaborate please

pavelweb wrote:
Editors need to be modified along with the suggestions in this thread then dates appear to work fine

https://www.nopcommerce.com/boards/t/44510/date-format-in-admin-area.aspx#188597

@model DateTime?
@using System.Globalization

<input id="@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)" name="@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)" value="@(Model > DateTime.MinValue || Model.HasValue ? Model.Value.ToString(CultureInfo.CurrentCulture.DateTimeFormat) : null)" />
<script>
    $(document).ready(function () {
        $("#@ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty)").kendoDateTimePicker({
            popup: {
                position: "bottom right",
                origin: "top right"
            },
            format: "dd/MM/yyyy HH:mm"
        });
    });
</script>
6 years ago
Guys, I am using 4.0 and there is no global.asax I can find from source code. Can anyone advise how should I work around this issue in 4.0?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.