Base solution for your next web application
Open Closed

How to get date format based on specified region #9570


User avatar
0
ianbaddock created

Hi I have an issue similar to one that was raised below: https://support.aspnetzero.com/QA/Questions/7495/How-to-get-date-format-based-on-user-regional

I have my region set to English (Default) Australia from the regional settings page (we are running Abp.AspNetCore Version=5.1.0)

The dates are displaying the expected DD/MM/YYYY format ok within the generated data tables however do not display correctly for the datetimepicker control on page. Any ideas what's going on? would prefer to not have to change this manually.

$('.date-picker').datetimepicker({ locale: abp.localization.currentLanguage.name, format: 'L' });

<div class="form-group"> <label for="Project_CommencementDate">START DATE</label> <input class="form-control m-input date-picker" id="Project_CommencementDate" type="text" name="commencementDate" value="@Model.Project.CommencementDate" /> </div>


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Datepickers must use the moment's current locale. Could you execute moment.locale() in the browser console and see it's output ?

    When I try with the latest version of AspNet Zero and select "en-au" as the current langugage, datepicker and date on table uses the same format.