Last active
February 11, 2021 08:34
-
-
Save codingthat/b0930af12b6a519e44ea79ebb89f4db5 to your computer and use it in GitHub Desktop.
Bookmarklet to automatically set Trello card times to just before midnight whenever the due date is accessed...unless they're in a column called "Meetings"
This file contains hidden or 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
javascript:(function () { | |
const set_time_to_midnight = (a,b) => { | |
if (!document.querySelector('.js-open-move-from-header') | |
|| document.querySelector('.js-open-move-from-header').innerText === 'Meetings' | |
|| !document.querySelector('.js-dpicker-time-input')) return; | |
document.querySelector('.js-dpicker-time-input').value = '11:59 PM' | |
}; | |
const config = { childList: true, subtree: true }; | |
let bootstrap_observer; | |
bootstrap_observer = new MutationObserver(set_time_to_midnight); | |
bootstrap_observer.observe(document.getElementById('trello-root'), config); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, a recent Trello update has broken this, but also made it more complicated to fix. Simply updating the query selector doesn't do the trick, because changing the
.value
only changes what's displayed, and not what is sent when you click Save.