Extract the granularity-picking code of the date ticker into a new function.