Last active
October 24, 2019 10:40
-
-
Save klhall1987/a25d93ebf71de6c7050f00a00f934cd0 to your computer and use it in GitHub Desktop.
Make Translatable strings with Ninja Forms Date Picker.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Date Picker test | |
*/ | |
add_filter( 'ninja_forms_enqueue_scripts', 'nf_datepicker_options' ); | |
function nf_datepicker_options() | |
{ | |
wp_enqueue_script( 'nf_datepicker_options', plugin_dir_url( __FILE__ ) . 'script.js', array( 'jquery' ), false, true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) { | |
dateObject.pikaday._o.i18n = { | |
previousMonth : 'Previous Month', | |
nextMonth : 'Next Month', | |
months : ['January','February','March','April','May','June','July','August','September','October','November','December'], | |
weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], | |
weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] | |
}; | |
} | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm also interested in knowing how to implement this?? Can anyone tell me/us?