Update field based on date

You can find example here on the forum, e.g. here: Custom Grouping Order