Set custom datetime range based on template variable value

As shown in the pic, i have three variable runId, run start time and run end time. on selecting runId, start and end time values will get loaded. i want to set this time range(start and end time variable) as custom time range values selected in Datepicker. How to achieve it.

Any workaround possible?