

Time::Moment 0.27 introduces the concept of $tm->with($adjuster). The adjuster is a CODE reference which is invoked with an instance of Time::Moment and is expected to return the same.

Time::Moment comes with Time::Moment::Adjusters which currently only provides routines for navigating/finding the day of week.

The following is also available on CPAN, as us_federal_holidays.pl or on github.