Skip to content

Commit 370d472

Browse files
authored
Merge pull request #33 from davesgonechina/patch-1
Add column for non-ISO day_of_week
2 parents f877c86 + 7893f51 commit 370d472

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# dbt-date v0.2.8
2+
3+
## Features
4+
5+
6+
## Fixes
7+
8+
* Switched `day_of_week` column in `get_date_dimension` from ISO to *not* ISO to align with the rest of the package. [#33](https://github.com/calogica/dbt-date/pull/33) (@davesgonechina)
9+
* Added `day_of_week_iso` column to `get_date_dimension` [#33](https://github.com/calogica/dbt-date/pull/33) (@davesgonechina)
10+
* Refactored Snowflake's `day_name` to not be ISO dependent [#33](https://github.com/calogica/dbt-date/pull/33) (@davesgonechina)
11+
112
# dbt-date v0.2.7
213

314
## Features

macros/calendar_date/day_name.sql

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
dayname({{ date }})
1313
{%- else -%}
1414
-- long version not implemented on Snowflake so we're doing it manually :/
15-
case {{ dbt_date.day_of_week(date) }}
16-
when 1 then 'Monday'
17-
when 2 then 'Tuesday'
18-
when 3 then 'Wednesday'
19-
when 4 then 'Thursday'
20-
when 5 then 'Friday'
21-
when 6 then 'Saturday'
22-
when 7 then 'Sunday'
15+
case dayname({{ date }})
16+
when 'Mon' then 'Monday'
17+
when 'Tue' then 'Tuesday'
18+
when 'Wed' then 'Wednesday'
19+
when 'Thu' then 'Thursday'
20+
when 'Fri' then 'Friday'
21+
when 'Sat' then 'Saturday'
22+
when 'Sun' then 'Sunday'
2323
end
2424
{%- endif -%}
2525

macros/get_date_dimension.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ select
2222
{{ dbt_date.tomorrow('d.date_day') }} as next_date_day,
2323
d.prior_year_date_day as prior_year_date_day,
2424
d.prior_year_over_year_date_day,
25-
{{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,
26-
25+
{{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,
26+
{{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,
2727
{{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,
2828
{{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,
2929
{{ dbt_date.day_of_month('d.date_day') }} as day_of_month,
@@ -129,4 +129,4 @@ select
129129
from
130130
dates_with_prior_year_dates d
131131
order by 1
132-
{% endmacro %}
132+
{% endmacro %}

0 commit comments

Comments
 (0)