As it seems the values last-week, last-month of the when argument are really meant to mean last 7 days and last 30 days, respectively. Given the current names, one could suspect to get the last full week (Mon - Sun) and the last full month (1 to 28, 29, 30, or 31 days).
Thus, my suggestion is to introduce more explicit names (last-7-days, last-30-days), maybe additionally (and discourage use of last-week, last-month but allow for them as back-compatiblilty).
As it seems the values
last-week
,last-month
of thewhen
argument are really meant to mean last 7 days and last 30 days, respectively. Given the current names, one could suspect to get the last full week (Mon - Sun) and the last full month (1 to 28, 29, 30, or 31 days).Thus, my suggestion is to introduce more explicit names (
last-7-days
,last-30-days
), maybe additionally (and discourage use oflast-week
,last-month
but allow for them as back-compatiblilty).