-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: [DEV-9001] date format for table #1666
base: dev
Are you sure you want to change the base?
Conversation
|
||
if (isDateTime && !config.table.dateDisplayFormat) { | ||
cellValue = formatDate(config.xAxis?.dateDisplayFormat, parseDate(config.xAxis?.dateDisplayFormat, labelValue)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this more readable:
if (isDateTime) { const dateDisplayFormat = config.table?.dateDisplayFormat || config.xAxis?.dateDisplayFormat; cellValue = formatDate(dateDisplayFormat, parseDate(dateDisplayFormat, labelValue) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was for this and the if statement above it. You can handle both with these couple lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain more please? I did not understood the issue here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code is readable. should we remove if statement or add alll logic here : if ((column === config.xAxis?.dataKey && type === 'date') || (type === 'date-time' && type === 'continuous')) {
: labelValue | ||
cellValue = | ||
config.xAxis?.type === 'continuous' ? formatNumber(runtimeData[row][column], 'bottom', false, config) : labelValue | ||
let { type, dateDisplayFormat } = config.xAxis || {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
cellValue = | ||
config.xAxis?.type === 'continuous' ? formatNumber(runtimeData[row][column], 'bottom', false, config) : labelValue | ||
let { type, dateDisplayFormat } = config.xAxis || {} | ||
let dateFormat = config.table?.dateDisplayFormat || dateDisplayFormat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
cellValue = formatNumber(runtimeData[row][column], 'bottom', false, config) | ||
} else { | ||
cellValue = labelValue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic works otherwise, just change those above consts since those aren't variable.
[Replace With Ticket Number]
Testing Steps
Open Bar/Line/Combo charts.
Switch to Date time or Date scale
Enter date format for text field "Data Table date display format" which updates only data table if entered.
The data table date format should be changed entered date format.
Self Review
Screenshots (if applicable)
Additional Notes