Skip to content

Commit

Permalink
fix: time unit
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed May 22, 2024
1 parent 4c94117 commit 917a7cf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/graphic-walker/src/vis/spec/encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@ export function availableChannels(geomType: string): Set<string> {
function encodeTimeunit(unit: (typeof DATE_TIME_DRILL_LEVELS)[number]) {
switch (unit) {
case 'iso_year':
return 'year';
case 'year':
return 'utcyear';
case 'quarter':
return 'yearquarter';
return 'utcyearquarter';
case 'month':
return 'yearmonth';
return 'utcyearmonth';
case 'iso_week':
case 'week':
return 'yearweek';
return 'utcyearweek';
case 'day':
return 'yearmonthdate';
return 'utcyearmonthdate';
case 'hour':
return 'yearmonthdatehours';
return 'utcyearmonthdatehours';
case 'minute':
return 'yearmonthdatehoursminutes';
return 'utcyearmonthdatehoursminutes';
case 'second':
return 'yearmonthdatehoursminutesseconds';
return 'utcyearmonthdatehoursminutesseconds';
}
return unit;
}
Expand Down

0 comments on commit 917a7cf

Please sign in to comment.