Hello swashwebdesign, you can customize language and week start day like this: enqueue a new js via your theme functions.php
function my_nf_datepicker_localization(){
wp_enqueue_script( 'nf_datepicker_options', get_stylesheet_directory_uri() . '/js/datepicker-de_DE.js', array( 'jquery' ), false, true );
}
add_filter( 'ninja_forms_enqueue_scripts', 'my_nf_datepicker_localization' );
And then drop datepicker-de_DE.js js file in /js folder of your theme
jQuery( document ).ready( function() {
new(Marionette.Object.extend( {
initialize: function() {
this.listenTo( Backbone.Radio.channel( 'pikaday' ), 'init', this.modifyDatepicker );
},
//Change the strings below to translate the string in our datepicker.
modifyDatepicker: function( dateObject, fieldModel ) {
console.log(dateObject);
console.log(fieldModel);
dateObject.pikaday._o.i18n = {
previousMonth : 'Vormonat',
nextMonth : 'N?chster Monat',
months : ['Januar', 'Februar', 'M?rz', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
weekdays : ['Sonntag', 'Montag','Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
weekdaysShort : ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.']
};
//no date selection in the past
dateObject.pikaday._o.minDate = moment().toDate();
//Monday is first week day
dateObject.pikaday._o.firstDay = 1;
}
}));
});
-
This reply was modified 7 years, 9 months ago by Mad Max.