Topic: Datepicker translation of weekdays labels

Peter_ free asked 6 years ago


Hi,

I try to place a translated datepicker into a form. Functionality is fine but I am unable to translate the one letter labels of the weekdays. Can you please help me with this?

Here is what I mean:

https://ibb.co/cGgizx

 

Regards

Peter


Peter_ free answered 6 years ago


Hi Mikolaj, thank you, I will try with another version. Best regards Peter

Mikołaj Smoleński staff commented 6 years ago

Let me know if it worked. Regards

Mikołaj Smoleński staff answered 6 years ago


Hello again, Here is my datepicker config: $('.datepicker').pickadate({ 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'], weekdaysShort: ['S','M','D','M','D','F','S'], weekdaysFull: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], format: 'dddd, dd. mmmm yyyy', formatSubmit: 'dd.mm.yyyy', today: 'Heute', clear: 'cancel', close: 'OK', firstDay: 1 }); It's working correct in my project. Here You have the screenshot: https://ibb.co/cc6fmc I recommend to update MDB to the latest version. Regards

Peter_ free answered 6 years ago


Hi Mikolaj, I am confused too :) The first picture shows the problem, the labels of the weekdays are in English. I need them in German. Instead of [M,T,W,T,F,S,S] i need [M,D,M,D,F,S,S]. I modified the code as follows: $('.datepicker').pickadate({ 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: [ 'S', 'M', 'D', 'M', 'D', 'F', 'S' ], format: 'ddd, dd. mmmm yyyy', formatSubmit: 'dd.mm.yyyy', today: 'Heute', clear: '<i class="material-icons">cancel</i>', close: 'OK', firstDay: 1 }); In the second picture (attached below) you can see in the form on the back, that the short weekdays are perfectly fine. Just not the one letters on the datepicker itself. Please help. https://ibb.co/hLCEPx Regards Peter  

Mikołaj Smoleński staff answered 6 years ago


Hi, I am confused. What is the problem with short weekdays? In Your example translation is working correctly. You should only move the last value to the firts position. Regards

Peter_ free answered 6 years ago


Hi Mikolaj,   thank you for the quick reply. Unfortunately this is not the solution for the problem for me. Here is my code: $('.datepicker').pickadate({ 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'], weekdaysShort: ['M','D','M','D','F','S','S'], weekdaysFull: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], format: 'dddd, dd. mmmm yyyy', formatSubmit: 'dd.mm.yyyy', today: 'Heute', clear: '<i class="material-icons">cancel</i>', close: 'OK', firstDay: 1 }); Thank you for your help Peter  

Mikołaj Smoleński staff answered 6 years ago


Hi, To translate weekdays please use the following code: $('.datepicker').pickadate({ weekdaysShort: ['P', 'W', 'S', 'C', 'P', 'S', 'N'], }); Regards

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 jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags