JasonRake
7 years agoQrew Trainee
Pass date time in mm/dd/yy hh:mm:ss format from iol js script
I have the below code in my iol java script page and it works for what I need. The problem is _fid_18 shows the time as a string of numbers on the form and not as dd/mm/yyyy hh:mm:ss until after the form is saved. Once the form is saved it displays in the proper format. I am looking at for a way to format the date in the java script page but so far everything I try breaks the script. Can anyone help me out with this?
(function(){
$("a.QBU_Button").on("click", function(event) {
new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resolve, reject);
}).then(position => {
_fid_37.value = position.coords.latitude;
_fid_38.value = position.coords.longitude;
_fid_18.value = new Date().getTime() - 14400000
});
});
})();
(function(){
$("a.QBU_Button").on("click", function(event) {
new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resolve, reject);
}).then(position => {
_fid_37.value = position.coords.latitude;
_fid_38.value = position.coords.longitude;
_fid_18.value = new Date().getTime() - 14400000
});
});
})();