Topic: Datepicker translation freezes widget

Michael Klein pro asked 3 years ago


*Expected behavior*Datepicker is translated with the Language strings from the documentation

*Actual behavior*Datepicker is showing translation but can't be closed and is unusable

Resources (screenshots, code snippets etc.)

            <div class="form-outline datepicker datepicker-translated" data-mdb-format="dd.mm.yyyy">
                <input
                    id="date_origin"
                    name="date_origin"
                    value="01.01.1900"
                    type="text"
                    class="form-control"
                    placeholder="dd.mm.yyyy"
                />
                <label for="date_origin" class="form-label">Rechnungsdatum</label>
            </div>

Javascript: (Copy & Paste from Documentation)

const datepickerTranslated = document.querySelector('.datepicker-translated'); 
new mdb.Datepicker(datepickerTranslated, { 
    title: 'Datum auswählen', 
    monthsFull: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 
    monthsShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov','Dez'], 
    weekdaysFull: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], 
    weekdaysShort: ['Son', 'Mon', 'Die', 'Mit', 'Don', 'Fre', 'Sam'],
    weekdaysNarrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
    okBtnText: 'Ok', 
    clearBtnText: 'Klar',
    cancelBtnText: 'Schließen', 
});

Grzegorz Bujański staff answered 3 years ago


Hi. Remove the CSS .datepicker class and everything should work.


Michael Klein pro commented 3 years ago

This worked, thank you.



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: Pro
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 3.0.0
  • Device: all
  • Browser: all
  • OS: Windows, Android
  • Provided sample code: No
  • Provided link: No