How to copy Date and Time to Date Picker

  • dianner
    Asked on January 28, 2020 at 1:58 PM

    I want to ask the user for one Date and Start and End Times. I use the Date Picker field to get the date and the Time field for each of the start and end times. However, I want to use the Google Calendar integration, which requires the Date Picker with date and time for both start and end dates/times. But, I don't want to show the Date Picker  to the user since I don't want the user to specify more than 1 date. I have created a test file at https://www.jotform.com/build/200245114373039 to show what I want, with the fields for Google Calendar hidden. Is there some way to get the fields from the Date and Time fields into the final Date Picker fields that Google Calendar needs? Apparently they can't just be copied. I see names of the fields under the Advanced tab. I know these can be used for CSS. But, can they be used in possibly a script or some API? 

  • Elton Support Team Lead
    Replied on January 28, 2020 at 5:36 PM

    I think it would be so much easier if you just use 2 date picker fields with time enabled for both start and end time then just copy the first date picker field to the 2nd date picker field. This will only pass the date value, excluding the time.

    How to copy Date and Time to Date Picker Image 1 Screenshot 30

    Example condition:

    How to copy Date and Time to Date Picker Image 2 Screenshot 41

    If you want to hide the date on the 2nd date picker field so your users only see the time field, you can do that by injecting custom CSS code to your form. Guide: How to Inject Custom CSS Codes

    If you need further assistance, let us know.