fix(data-vi): issue where getting timezone from context (#5743)

* fix(data-vi): issue where getting timezone from context

* fix: test
This commit is contained in:
YANG QIA 2024-11-27 19:48:07 +08:00 committed by GitHub
parent 6bd5b9b54c
commit 9f255eba89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -71,7 +71,6 @@ describe('formatter', () => {
const ctx = {
app,
db,
timezone: '+05:30',
action: {
params: {
values: {
@ -85,6 +84,7 @@ describe('formatter', () => {
},
},
},
get: () => '+05:30',
} as any;
const queryParser = createQueryParser(db);
await compose([parseFieldAndAssociations, queryParser.parse(), queryData])(ctx, async () => {});
@ -112,7 +112,7 @@ describe('formatter', () => {
const ctx = {
app,
db,
timezone: '+05:30',
get: () => '+05:30',
action: {
params: {
values: {
@ -153,7 +153,7 @@ describe('formatter', () => {
const ctx = {
app,
db,
timezone: '+05:30',
get: () => '+05:30',
action: {
params: {
values: {
@ -202,7 +202,7 @@ describe('formatter', () => {
const ctx = {
app,
db,
timezone: '+05:30',
get: () => '+05:30',
action: {
params: {
values: {
@ -250,7 +250,7 @@ describe('formatter', () => {
const ctx = {
app,
db,
timezone: '+05:30',
get: () => '+05:30',
action: {
params: {
values: {

View File

@ -97,7 +97,7 @@ export class QueryParser {
attributes: dimensionAttributes,
group,
fieldMap: dimensionFieldMap,
} = this.parseDimensions(ctx, dimensions, hasAgg, ctx.timezone);
} = this.parseDimensions(ctx, dimensions, hasAgg, ctx.get?.('x-timezone'));
const order = this.parseOrders(ctx, orders, hasAgg);
ctx.action.params.values = {