Comment by onceonceonce
2 hours ago
been hand-rolling date -d plus a wrapper script for newsletter scheduling for years. Stuff like "next second Tuesday after a holiday" and "convert these timestamps to a reader's local time before send". biff time seq monthly -w 2-tue would have replaced about 40 lines of bash for me.
Yes!!! To spell it out (with the new biff -> bttf name):
More examples here: https://github.com/BurntSushi/biff/blob/master/GUIDE.md#date...
Implementing the RFC 5545 recurrence rules was quite a lot of fun: https://github.com/BurntSushi/biff/blob/4c75d5cf6e09310e74ca...
I'm quite proud of it, because if you look at the implementation, it's almost entirely about dealing with the specification rules. All of the datetime bullshit (including handling time zones) is all deferred to Jiff.
Plus, the tests are nearly 4,000 lines. While the implementation is 2,000 lines.
I implemented those recursion rules (probably very poorly) years ago. I still often think about the ways I did and probably should have handled those. It was an interesting problem.