Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created August 31, 2013 13:57
Show Gist options
  • Save steffenr/6398380 to your computer and use it in GitHub Desktop.
Save steffenr/6398380 to your computer and use it in GitHub Desktop.
Depending to-date with jQuery datepicker
(function($) {
Drupal.behaviors.date_popup_custom = {};
Drupal.behaviors.date_popup_custom.attach = function(context, settings) {
// Add departure date same as arrival date
$('.form-item-d-departure-date').find('input').click(function() {
var arrival_date = $('.form-item-d-arrival-date').find('input').val();
$('.form-item-d-departure-date').find('input').datepicker( "setDate" , arrival_date );
});
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment