[BE] Code Hotspots: Re-factor timeframe validation
Discovery Issue: https://gitlab.com/gitlab-org/gitlab-ee/issues/12683
This is a follow-up from an MR review comment: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14719#note_203753264
The timeframe selection for user could evolve later. It might be easier to use Xdays and re-use code from Productivity Analytics. The idea is to re-factor this separately from the above MR.
Edited by Aakriti Gupta