>> replaceparts(d::Date; year=year(d), month=month(d), day=day(d)) = typeof(d)(year, month, day)
>> replaceparts(Date(2001,01,01), month=4)
2001-04-01
This works, though maybe there’s a better way via ConstructionBase/BangBang. I’m not sure how to use those packages without piracy. (cc @tkf @jw3126 if you happen to have any thoughts)