Typo3: Powermail Configuring JQuery Datepicker

The powermail Typo3 extension for creating and managing forms provides a great integration with the jQuery JavaScript library. This includes the jQuery UI widgets especially the date picker widget.

However, this makes use of the default jQuery settings and for example for a German website the default date format (mm/dd/YY) is not satisfying.
To change the default behaviour, some JavaScript settings are necessary. The following JavaScript code can be integrated either in a seperate JS file or can be included in an already included one. Anyhow, it has to be loaded after the default powermail and jQuery JavaScript files.


$(function() {
$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
prevText: '', nextStatus: 'nächsten Monat zeigen',
currentText: 'heute', currentStatus: '',
monthNames: ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],
monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
weekHeader: 'Wo', weekStatus: 'Woche des Monats',
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
dateFormat: 'dd.mm.yy', firstDay: 1,
initStatus: 'Wähle ein Datum', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);

$.datepicker.setDefaults( $.datepicker.regional[ "" ] );
$( ".powermail_date" ).datepicker( $.datepicker.regional[ "de" ] );
});

Leave a Comment