Skip to content

Instantly share code, notes, and snippets.

@programmin1
Created March 14, 2021 06:38
Show Gist options
  • Save programmin1/28ac27d95fa31c4a1e823a377f2e0867 to your computer and use it in GitHub Desktop.
Save programmin1/28ac27d95fa31c4a1e823a377f2e0867 to your computer and use it in GitHub Desktop.
61 day calculator
// 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