Created
November 30, 2016 18:09
-
-
Save kjohnson/9c49c64ff5465927b691d677b0bbe863 to your computer and use it in GitHub Desktop.
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: 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 ); | |
} |
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 ); | |
}, | |
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