Skip to content

Commit 0df7f10

Browse files
authored
fix: DH-21869: Fix Conditional Formatting on Timestamp (#2635)
- the time stamps need to be single quoted as date-time liters per our docs: https://deephaven.io/core/docs/how-to-guides/date-time-literals/ - The backend parsing fails on timezone abbreviations ending with ST or DT. If you have EST or EDT, you need to pass in ET. I have updated the validation to prevent passing these to the backend.
1 parent 58ff25e commit 0df7f10

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

packages/iris-grid/src/sidebar/conditional-formatting/ConditionalFormattingUtils.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -569,17 +569,17 @@ export function getTextForDateCondition(
569569
): string {
570570
switch (condition) {
571571
case DateCondition.IS_EXACTLY:
572-
return `${columnName} == convertDateTime("${value}")`;
572+
return `${columnName} == '${value}'`;
573573
case DateCondition.IS_NOT_EXACTLY:
574-
return `${columnName} != convertDateTime(\`${value}\`)`;
574+
return `${columnName} != '${value}'`;
575575
case DateCondition.IS_BEFORE:
576-
return `${columnName} < convertDateTime(\`${value}\`)`;
576+
return `${columnName} < '${value}'`;
577577
case DateCondition.IS_BEFORE_OR_EQUAL:
578-
return `${columnName} <= convertDateTime("${value}")`;
578+
return `${columnName} <= '${value}'`;
579579
case DateCondition.IS_AFTER:
580-
return `${columnName} > convertDateTime(\`${value}\`)`;
580+
return `${columnName} > '${value}'`;
581581
case DateCondition.IS_AFTER_OR_EQUAL:
582-
return `${columnName} >= convertDateTime(\`${value}\`)`;
582+
return `${columnName} >= '${value}'`;
583583
case DateCondition.IS_NULL:
584584
return `${columnName} == null`;
585585
case DateCondition.IS_NOT_NULL:
@@ -745,6 +745,16 @@ export function isDateConditionValid(
745745
return false;
746746
}
747747

748+
// The backend timestamp parsing does not support timezones that end with ST or DT (e.g. EST, EDT)
749+
// Passing these to the backend will cause the table to fail.
750+
if (
751+
tzCode.toUpperCase().endsWith('ST') ||
752+
tzCode.toUpperCase().endsWith('DT')
753+
) {
754+
log.debug('Timezone ending with ST or DT not supported', tzCode);
755+
return false;
756+
}
757+
748758
return true;
749759
}
750760
}

0 commit comments

Comments
 (0)