Skip to content

Instantly share code, notes, and snippets.

@FernandoBontorin
Last active April 7, 2023 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoBontorin/e7e0352540399a5f9e7a8d034b3e997a to your computer and use it in GitHub Desktop.
Save FernandoBontorin/e7e0352540399a5f9e7a8d034b3e997a to your computer and use it in GitHub Desktop.
snipa o pessoal e pa
function snip(dateISOformat, diff=0){
var target = new Date(dateISOformat).getTime();
var duration = document.getElementById("date_arrival").firstElementChild.getAttribute("data-duration")*1000;
var send = target-duration;
var timeout = send-new Date().getTime()-18000;
setTimeout(()=>{document.getElementById("troop_confirm_submit").click()}, timeout+diff);
console.log(new Date(timeout).toUTCString().slice(-11, -4));
};snip("2023-04-08T09:26:30.100-03:00", -34219)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment