abp icon indicating copy to clipboard operation
abp copied to clipboard

Date Format and localization (en-GB)

Open zaktecs opened this issue 6 years ago • 4 comments

Hi,

Where can I set the uiCulture to UK as I'm having problems using this date format "dd/mm/yyyy". I Get Invalid data when i pass the date format in en-GB

Kind Regards, Zak

Documentation

Please check the official documentation before asking questions: https://docs.abp.io

GitHub Issues

GitHub issues are for bug reports, feature requests and other discussions about the framework.

If you're creating a bug/problem report, please include followings:

  • Your ABP Framework version.
  • Your User Interface type (Angular/MVC/React... etc.) if the issue is related to a specific UI
  • Exception message and stack trace if available (check the logs).
  • Steps needed to reproduce the problem.

Please write in English.

Stack Overflow

Please use Stack Overflow for your questions about using the framework, templates and samples:

https://stackoverflow.com/questions/tagged/abp

Use abp tag in your questions.

zaktecs avatar Jun 29 '20 15:06 zaktecs

Please provide the necessary information for the issue.

GitHub Issues

GitHub issues are for bug reports, feature requests and other discussions about the framework.

If you're creating a bug/problem report, please include followings:

  • Your ABP Framework version.
  • Your User Interface type (Angular/MVC/React... etc.) if the issue is related to a specific UI
  • Exception message and stack trace if available (check the logs).
  • Steps needed to reproduce the problem.

maliming avatar Jun 30 '20 01:06 maliming

Hi, Thanks for your support.

I'm currently using Version 2.9 with MVC

as mentioned earlier it doesn't accept british date format dd/mm/yyyy. I get an Invalid date but if I change it to US Date Format (mm/dd/yyyy) then it passes

I need to change the localization to (en-GB) and UK Date format.

Cheers

Zak

zaktecs avatar Jun 30 '20 12:06 zaktecs

Hi @zaktecs,

You can set language parameter of your datepicker object with abp.localization.currentCulture.cultureName

Example:

<abp-input asp-for="MyDate" type="text" class="datepicker" />

and my js file

$('input.datepicker').datepicker({
            todayBtn: "linked",
            autoclose: true,
            language: abp.localization.currentCulture.cultureName
        }).on('hide', function (e) { e.stopPropagation(); });

My results: TR resim

EN resim

PT resim

All types are working with backend with no problem.

cotur avatar Jun 30 '20 13:06 cotur

@cotur , many thanks for your help.

Zak

zaktecs avatar Jun 30 '20 15:06 zaktecs