Skip to content

Commit

Permalink
feat: add iso year and week feature (#386)
Browse files Browse the repository at this point in the history
* feat: add iso datetime function

* fix: dataTable

* fix: color combo box

* fix: time unit

* chore: change week def to duckdb

* fix: dataTable
  • Loading branch information
islxyqwe authored May 26, 2024
1 parent e348f31 commit caf237a
Show file tree
Hide file tree
Showing 13 changed files with 708 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function Pagination(props: PaginationProps) {
<PaginationEllipsis />
</PaginationItem>
)}
{showIndices.slice(1, -1).map((page) => pageButton(page.index))}
{showIndices.slice(1, showIndices.length > 2 ? -1 : undefined).map((page) => pageButton(page.index))}
{showIndices.length > 2 && showIndices[showIndices.length - 1].index > showIndices[showIndices.length - 2].index + 1 && (
<PaginationItem>
<PaginationEllipsis />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ function Combobox({
<CommandItem
key={opt.value}
value={opt.value}
onSelect={(currentValue) => {
if (currentValue === '_none') {
onSelect={() => {
if (opt.value === '_none') {
onSelect?.('');
} else {
onSelect?.(currentValue === selectedKey ? '' : currentValue);
onSelect?.(opt.value === selectedKey ? '' : opt.value);
}
setOpen(false);
}}
Expand Down
19 changes: 14 additions & 5 deletions packages/graphic-walker/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
export const COUNT_FIELD_ID = 'gw_count_fid';
export const DATE_TIME_DRILL_LEVELS = [
"year", "quarter", "month", "week", "day", "hour", "minute", "second"
] as const;
export const DATE_TIME_DRILL_LEVELS = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'iso_year', 'iso_week'] as const;
export const DATE_TIME_FEATURE_LEVELS = [
"year", "quarter", "month", "week", "weekday", "day", "hour", "minute", "second"
'year',
'quarter',
'month',
'week',
'weekday',
'day',
'hour',
'minute',
'second',
'iso_year',
'iso_week',
'iso_weekday',
] as const;

export const MEA_KEY_ID = 'gw_mea_key_fid';
export const MEA_VAL_ID = 'gw_mea_val_fid';
export const PAINT_FIELD_ID = 'gw_paint_fid';
export const PAINT_FIELD_ID = 'gw_paint_fid';
Loading

0 comments on commit caf237a

Please sign in to comment.