Comment by burntsushi
3 hours ago
Yes!!! To spell it out (with the new biff -> bttf name):
$ bttf time seq monthly -w 2-tue -u 1y | bttf time fmt -f '%c'
Tue, Jun 9, 2026, 11:15:11 AM EDT
Tue, Jul 14, 2026, 11:15:11 AM EDT
Tue, Aug 11, 2026, 11:15:11 AM EDT
Tue, Sep 8, 2026, 11:15:11 AM EDT
Tue, Oct 13, 2026, 11:15:11 AM EDT
Tue, Nov 10, 2026, 11:15:11 AM EST
Tue, Dec 8, 2026, 11:15:11 AM EST
Tue, Jan 12, 2027, 11:15:11 AM EST
Tue, Feb 9, 2027, 11:15:11 AM EST
Tue, Mar 9, 2027, 11:15:11 AM EST
Tue, Apr 13, 2027, 11:15:11 AM EDT
Tue, May 11, 2027, 11:15:11 AM EDT
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.