Created
March 14, 2021 06:38
-
-
Save programmin1/28ac27d95fa31c4a1e823a377f2e0867 to your computer and use it in GitHub Desktop.
61 day calculator
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
// Use on https://www.nasdaq.com/market-activity/stocks/alsn/dividend-history | |
// for example. | |
// Disclaimer - Not intented or guaranteed for official tax purposes. YMMV | |
jQuery('.dividend-history__row').each(function(i, e) { | |
jQuery(e).children().eq(0).on('click', function() { | |
console.log(this.textContent + ' qualified? held 61 days within '); | |
let exdiv = new Date(this.textContent); | |
let dt = exdiv; | |
dt.setDate(dt.getDate() - 60); | |
console.log(dt.toDateString()); | |
dt.setDate(dt.getDate() + 121); | |
console.log(dt.toDateString()); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment