Created
November 6, 2012 18:33
-
-
Save theophani/4026580 to your computer and use it in GitHub Desktop.
Untitled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drag this link into your | |
bookmark bar: | |
<a href='javascript: function () { var field = document.querySelector("#promotion_days"); function days(date) { var parts = date.split("-"); // YY-MM-DD var year = parseInt(parts[0]) + 2000; var month = parseInt(parts[1]) - 1; var day = parseInt(parts[2]); console.log(year, month, day); var now = new Date(); var then = new Date(year, month, day, 0,0,0,0); var days = Math.ceil((then - now) / 1000 / 3600 / 24); return days; } var date = prompt("When should this gift expire? Tell me in YY-MM-DD format!"); field.value = days(date);}'>Gift Expiry</a> | |
<br> | |
<br> | |
Then while looking at a gift form, click the bookmarklet :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment