Topic: How to properly translate 2 datepickers in one form?

IvaRoSoft priority asked 2 years ago

1, Translation of date stamps 1, 2 or 3, according to translation (SK). 2, Show date selection button 2. 3, Set the first day of the week to Monday.

According to the example, only datepicker 1 is displayed correctly.

enter link description here

Dawid Wajszczuk staff answered 2 years ago


For the first snippet, you need to select all datepickers with class datepicker-translated with querySelectorAll and then make initialization for each of them with forEach loop. Here is the snippet with working example Here is another great snippet made by one of our users

As for your second snippet, I don't understand what the problem is. Can you explain it in more details?

Keep coding,

IvaRoSoft priority commented 2 years ago

Thanks for the help and answer, yes I needed this.

As for the second template, I gave it as an example for a form with two dates, (Order, start date - end date). How to proceed in the second example?

Dawid Wajszczuk staff commented 2 years ago

I still have no idea about what is wrong with second template. It is working fine. Another approach for this problem would be to listen for date change in both datepickers, then when this event fires and date has been successfully changed, dispose second datepicker and reinitialize with new options for min/max date (depending if it is datepicker for start or end date) and maybe start date.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.1
  • Device: notebook HP
  • Browser: chrome
  • OS: windows 10
  • Provided sample code: No
  • Provided link: Yes