https://github.com/elastic/elasticsearch/pull/120302 introduced some regressions in date rounding performance, that were addressed by https://github.com/elastic/elasticsearch/pull/128687. In terms of code architecture though, the solution could be refined and made more clean and consistent