Accepts a DateTime, DateOnly, or legacy Date object as input. Returns an object of the same type that corresponds to the first day (Monday) of the fiscal week that contains the specified date.
Example
SELECT OrderDate as "date", fiscal_week_first_day(OrderDate) as "fiscal_week_first_day" FROM "dates_sample_data";
| date | fiscal_week_first_day |
|---|---|
| 2015-01-21 15:30:00 | 2015-01-19 00:00:00 |
| 2015-01-21 00:00:00 | 2015-01-19 00:00:00 |
| 2015-01-31 10:00:30 | 2015-01-26 00:00:00 |
| 2015-02-03 15:30:00 | 2015-02-02 00:00:00 |
| 2016-01-21 23:59:59 | 2016-01-18 00:00:00 |
| 2015-10-31 23:59:59 | 2015-10-26 00:00:00 |
| 2015-12-03 00:00:00 | 2015-11-30 00:00:00 |
| 2016-01-11 03:30:00 | 2016-01-11 00:00:00 |
| 2016-01-11 03:30:00 | 2016-01-11 00:00:00 |