Hello,
How can I set the time while setting the date?
I have a working input with the <input id="datePicker" type="date"/>
That lets the user set a date in html calendar. Then a button with myDate2()
bind to it.
Relevant code:
$(document).ready( function() {
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day);
$('#datePicker').val(today);
});
function myDate2(){
const d = new Date($('#datePicker').val())
console.log(new Date($('#datePicker').val()))
viewer.clock.currentTime = new Cesium.JulianDate.fromDate(d);
}
This changes the date in the animation in the down left but the time is set to 00:00:00 UTC
How can I implement and html input type="time"
to this function so the user also can set a specific time and not have to play through the animation till it reaches the desired time of the day.
I’ve tried setting up a sandcastle link, but I did not get it to work since i have jquery code here.
Thanks in advance!