• Resolved aaronmoya

    (@aaronmoya)


    I am using this great plugin to reduce the amount of form fields my users have to fill out. In my use case, I have a start date/time and also an end date/time. The option to not go back previous dates works great but now I run into an issue with the End date/time. I can select a future date on my start date/time and a previous date on the End date/time. Can you suggest any way I can overcome this with some conditional logic or something? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @aaronmoya thank you for using the plugin. Currently this would only be possible if you’re able to add some custom javascript code into your page. But it would be a nice feature to have, so I’ll explore the possibility of having this feature for the plugin. But it might take some time.

    For reference, the javascript code we would need would be based on this: https://xdsoft.net/jqplugins/datetimepicker/#range which is the same script used by my plugin.

    Thread Starter aaronmoya

    (@aaronmoya)

    That would be epic! Thanks for sharing the info sir! Great plugin – I applaud your contribution to the community : )

    Thread Starter aaronmoya

    (@aaronmoya)

    In case this helps anyone, I am using gravity forms and this allowed me to add the range between date.

    jQuery(document).ready(function( $ ){
       jQuery(function(){
     jQuery('.date1 input[type=text]').datetimepicker({
      format:'MM/DD/YYYY h:mm a',
      onShow:function( ct ){
       this.setOptions({
        maxDate:jQuery('.date2 input[type=text]').val()?jQuery('.date2 input[type=text]').val():false
       })
      },
      timepicker:true
     });
     jQuery('.date2 input[type=text]').datetimepicker({
      format:'MM/DD/YYYY h:mm a',
      onShow:function( ct ){
       this.setOptions({
        minDate:jQuery('.date1 input[type=text]').val()?jQuery('.date1 input[type=text]').val():false
       })
      },
      timepicker:true
     });
    });
    });

    Awesome @aaronmoya ! Glad you managed to find the solution and thank you for sharing it.
    I’ll mark this ticket as solved then. Keep an eye on the updates, since I might include this option directly in the plugin in a future update (but as I said, it might take some time). Cheers, Carlos

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Start Date/Time | End Date/Time’ is closed to new replies.