DateTime picker not using local date seperator symbol on selection

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
gjd
User
Posts: 3

DateTime picker not using local date seperator symbol on selection

Post by gjd »

Hello,

i am using 2 languages en-GB and nl-NL.
In nl-NL locale setting date seperator is set to dd-MM-y

If local nl-NL is selected in frontend then in listview the date format is correct (22-04-23), but when i edit using datetime picker on return, in the textbox, it gives english format (22/04/23).
On save it saves correctly and shown as 22-04-23

Did i missed some setting?

thanks GJ


MichaelG
User
Posts: 1095

Post by MichaelG »

gjd wrote:

In nl-NL locale setting date seperator is set to dd-MM-y

  1. The default date format for nl-NL is dd-MM-y, so there is no need to set anything. You should click Tools -> Locale to reset the settings and delete the generated file wwwroot\locale\nl-NL.json.
  2. Generate all scripts again.
  3. Press Ctrl + F5 in your browser to make sure the new files are used.

gjd
User
Posts: 3

Post by gjd »

Unfortunately did seems not the solution. I reset locale settings and generated the files as you said.

On an Edit form, the date shows correctly in the selected local nl-NL format as for example 27-10-22.
Only after i select a date in datetimepicker it is changed and showing in the wrong format for example 23/04/23.

It seems that datetimepicker does not use the correct selected locale setting.

Any other idea?

thanks in advance.
GJ


MichaelG
User
Posts: 1095

Post by MichaelG »

  1. Make sure you have correct language ID (i.e. "nl-NL") specified in your language file (.xml).
  2. Make sure you have put the language file in the correct language folder (i.e. C:\Users\<user>\AppData\Roaming\ASPNETMaker2023\languages).
    Read Making Language Files for details.

gjd
User
Posts: 3

Post by gjd »

Thanks, they where correct already.

<ew-language version="20.0.0" id="nl-NL" name="Nederlands (Dutch)" desc="Nederlands (Dutch)" author="GJ">

This is not the issue. Global Language and locale selection just work fine. Also language translations work perfectly.

It is just the datetime picker giving wrong format on select back to the editable textbox. On page save it is also saved in correct format.

Perhaps you can try to reproduce same issue?

thanks GJ


MichaelG
User
Posts: 1095

Post by MichaelG »

I did try to reproduce and it works fine for me.


Post Reply