Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Created November 30, 2016 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kjohnson/9c49c64ff5465927b691d677b0bbe863 to your computer and use it in GitHub Desktop.
Save kjohnson/9c49c64ff5465927b691d677b0bbe863 to your computer and use it in GitHub Desktop.
<?php
/*
* Plugin Name: Ninja Forms - Datepicker Customizations
*/
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 );
}
jQuery( document ).ready( function() {
new(Marionette.Object.extend( {
initialize: function() {
this.listenTo( Backbone.Radio.channel( 'pikaday' ), 'init', this.modifyDatepicker );
},
modifyDatepicker: function( dateObject, fieldModel ) {
// dateObject.pikaday.setDate( '04/11/2016' );
// dateObject.pikaday.gotoYear( '2017' );
// dateObject.pikaday.setMinDate( new Date( 'December 21, 2016' ) );
}
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment