python function for weekends off


I know that this has popped up a few times before, but this is the python function that I use to insert weekends off for a goal. It only adds the next weekend beyond the akrasia horizon, but it is part of a script that gets run every time I update data, so that is fine for me. So far, it has been working without a problem, though there are likely bugs hiding in it (so use at your own risk).

here is the gist

let me know if anyone has any suggestions or thoughts.