Skip to content

Commit

Permalink
Merge pull request #375 from rpbouman/issue-373-support-for-iso-dayof…
Browse files Browse the repository at this point in the history
…week-and-iso-year

Fix #373
  • Loading branch information
rpbouman authored Jan 8, 2025
2 parents 1da3795 + a1a6e57 commit 0636b7f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AttributeUi/AttributeUi.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ main.layout:has( .workarea > .pivotTableUiContainer[aria-busy=true] ) > nav#side
/* calendar */
content: "\ea53";
}
details[data-nodetype=derived][data-derivation=iso-year] > summary > span.label::before,
details[data-nodetype=derived][data-derivation=year] > summary > span.label::before {
/* letter-y */
content: "\ec68";
Expand Down Expand Up @@ -301,6 +302,7 @@ main.layout:has( .workarea > .pivotTableUiContainer[aria-busy=true] ) > nav#side

details[data-nodetype=derived][data-derivation="day of week shortname"] > summary > span.label::before,
details[data-nodetype=derived][data-derivation="day of week name"] > summary > span.label::before,
details[data-nodetype=derived][data-derivation="iso-day of week"] > summary > span.label::before,
details[data-nodetype=derived][data-derivation="day of week num"] > summary > span.label::before {
/* letter-d-small */
content: "\fcca";
Expand Down
13 changes: 13 additions & 0 deletions src/AttributeUi/AttributeUi.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ class AttributeUi {
return fallbackFormatter;
}
},
'iso-year': {
folder: 'date fields',
expressionTemplate: "CAST( ISOYEAR( ${columnExpression} ) AS INT)",
columnType: 'INTEGER',
createFormatter: function(){
return fallbackFormatter;
}
},
'quarter': {
folder: 'date fields',
expressionTemplate: "'Q' || QUARTER( ${columnExpression} )",
Expand Down Expand Up @@ -287,6 +295,11 @@ class AttributeUi {
expressionTemplate: "CAST( DAYOFWEEK( ${columnExpression} ) as UTINYINT)",
columnType: 'UTINYINT',
},
'iso-day of week': {
folder: 'date fields',
expressionTemplate: "CAST( ISODOW( ${columnExpression} ) as UTINYINT)",
columnType: 'UTINYINT',
},
'day of week name': {
folder: 'date fields',
expressionTemplate: "CAST( DAYOFWEEK( ${columnExpression} ) as UTINYINT)",
Expand Down
2 changes: 2 additions & 0 deletions src/QueryUi/QueryUi.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ body > main:has( > menu[role=toolbar] > #currentDatasource:empty ) > #workarea >
content: "\ea53";
}

> li[data-derivation=iso-year] > span:before,
> li[data-derivation=year] > span:before {
/* letter-y */
content: "\ec68";
Expand Down Expand Up @@ -239,6 +240,7 @@ body > main:has( > menu[role=toolbar] > #currentDatasource:empty ) > #workarea >

> li[data-derivation="day of week shortname"] > span:before,
> li[data-derivation="day of week name"] > span:before,
> li[data-derivation="iso-day of week"] > span:before,
> li[data-derivation="day of week num"] > span:before {
/* letter-d-small */
content: "\fcca";
Expand Down

0 comments on commit 0636b7f

Please sign in to comment.