db_engine_specs: use correct sqlite week time grain (#4831)

We want the week of year %W and not the day of week %w
when using week as time grain.

Reference:
https://www.sqlite.org/lang_datefunc.html
This commit is contained in:
Riccardo Magliocchetti 2018-04-16 01:15:31 +02:00 committed by Maxime Beauchemin
parent 23a3365cd1
commit 3b18fbf9e3
1 changed files with 1 additions and 1 deletions

View File

@ -424,7 +424,7 @@ class SqliteEngineSpec(BaseEngineSpec):
'PT1H'),
Grain('day', _('day'), 'DATE({col})', 'P1D'),
Grain('week', _('week'),
"DATE({col}, -strftime('%w', {col}) || ' days')",
"DATE({col}, -strftime('%W', {col}) || ' days')",
'P1W'),
Grain('month', _('month'),
"DATE({col}, -strftime('%d', {col}) || ' days', '+1 day')",