Skip to content

Instantly share code, notes, and snippets.

@blackhalt
Created December 7, 2021 10:22
Show Gist options
  • Save blackhalt/659a4272e6e8e43c8656e87fcb073249 to your computer and use it in GitHub Desktop.
Save blackhalt/659a4272e6e8e43c8656e87fcb073249 to your computer and use it in GitHub Desktop.
Datuma bookmaklets
javascript:var d = new Date(),month = d.getMonth() + 1,date = d.getDate(),year = d.getFullYear(),area = document.getElementsByTagName("textarea")[0];area.value = year +"-"+ month +"-"+ date;void 0
@C9352AF2C9F83C72C22587A4003AF378

area.value = year +"-"+ ("0"+month).slice(-2) +"-"+ ("0"+date).slice(-2)

@blackhalt
Copy link
Author

javascript:var dt = new Date();year = dt.getFullYear();month = (dt.getMonth() + 1).toString().padStart(2, "0");day = dt.getDate().toString().padStart(2, "0");area = document.getElementsByTagName("textarea")[0];area.value = year +"-"+ month +"-"+ day;void 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment