Returns a range of the most recent full week starting from Sunday or some other day you specify. Can only be used as a range
parameter in for_date_range().
The time range selected for a report does not affect this function. That is, no matter what time range is selected for a report, this function always returns the most recent full week based on today's date.
Syntax
last_week([startDay])
Parameter
- startDay: Optional. An integer (1 through 7) that specifies which day you consider to be the first day of the week:
1
= Sunday2
= Monday3
= Tuesday4
= Wednesday5
= Thursday6
= Friday7
= Saturday
By default, Sunday is the starting day.
Examples
Clicks.for_date_range(last_week())
: Returns the number of clicks from the most recent Sunday to Saturday range.
Clicks.for_date_range(last_week(2))
: Returns the number of clicks from the most recent Monday to Sunday range.