sadpandajoe commented on code in PR #43909:
URL: https://github.com/apache/superset/pull/43909#discussion_r3941494910
##########
superset-frontend/packages/superset-ui-core/src/time-format/utils/stringifyTimeInput.ts:
##########
@@ -28,16 +28,27 @@ export default function stringifyTimeInput(
let time: Date;
if (typeof value === 'string') {
const trimmed = value.trim();
+ // A bare four-digit string is the ISO 8601 year-only form ("2017"), which
+ // every engine parses as January 1st of that year. Any other integer
+ // string is an epoch timestamp in milliseconds that was stringified on
+ // its way here, e.g. by the pivot table, and is not a valid Date input.
+ const isYear = /^\d{4}$/.test(trimmed);
Review Comment:
Pivot Table still converts a temporal `"2017"` header to a number before it
reaches this formatter, so it renders as 2.017 seconds after the epoch instead
of the year 2017. Should the row and column header coercion preserve four-digit
year strings so this change reaches those cells?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]