Topic: datepicker translated

csandoy free asked 3 years ago


when using datepicker and translated and clicking on icon the popup freezes Dato fra : const datepickerTranslated = document.querySelector('.datepicker-translated'); new mdb.Datepicker(datepickerTranslated, { title: 'vælg dato', monthsFull: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], monthsShort: ['jan', 'feb', 'Mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], weekdaysFull: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], weekdaysShort: ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'], weekdaysNarrow: ['s', 'm', 't', 'o', 't', 'f', 'l'], okBtnText: 'Ok', clearBtnText: 'nulstil', cancelBtnText: 'luk', });


Dawid Wajszczuk staff answered 2 years ago


Hi,

I think that this is due to double initialization of datepicker. In your html datepicker probably has datepicker class and also datepicker-transleted. In this situation class 'datepicker' initializes the first datepicker and then you initialize it for the second time via JS. Just remove datepicker class and it should work. Here is the snippet with this solution https://mdbootstrap.com/snippets/standard/d-wajszczuk/3073746#html-tab-view.

Keep coding,
Dawid



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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.5.1
  • Device: PC
  • Browser: New Edge
  • OS: Wndows 10
  • Provided sample code: No
  • Provided link: No