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

IvaRoSoft priority asked 1 year 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 1 year ago


Hi,

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 https://mdbootstrap.com/snippets/standard/d-wajszczuk/3488353. Here is another great snippet made by one of our users https://mdbootstrap.com/snippets/standard/kayem79/3156488#js-tab-view.

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

Keep coding,
Dawid


IvaRoSoft priority commented 1 year 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 1 year 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.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • User: 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