-
Notifications
You must be signed in to change notification settings - Fork 66
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
Generating CSV doesn’t include seconds and seconds fractions #114
Comments
We can use uiSettings.get('dateFormat') in frontend to get the date format in advanced settings. The API request needs to be modified or a new route needs to be added to support all advanced settings (context menu and dashboards server doesn't have direct access to uiSettings). Also the default timeFormat |
@joshuali925 |
@joshuali925 we can do this step by step, no need to support everyting in advanced settings at once. can start with date format |
@zhongnansu Yes this is doable, my concern is that But I'm not that familiar with csv processing tools, and if you feel it's ok to make the change then I can update the PR |
@joshuali925 Found some reference. elastic/kibana#56153 @kgcreative Hi Kevin, any thoughts? |
@zhongnansu Got it, then it's better to let users decide. I updated the PR |
@joshuali925 @zhongnansu - for report settings, I think it makes sense to add a "date format" field under "time range" An additional enhancement under the on-demand Date format should by default inherit user settings under |
Moving the discussion here #208 |
Is your feature request related to a problem? Please describe.
Currently for the date field in csv report. In the code there are 2 steps to handle date value.
format: date_hour_mintue
asdocValue
(e.g. yyyy-MM-dd'T'HH:mm)https://github.com/opensearch-project/dashboards-reports/blob/e5174537800c60b1bf3145a80c4a36ab4227b80b/dashboards-reports/server/routes/utils/savedSearchReportHelper.ts#L270
'MM/DD/YYYY h:mm:ss a',
(e.g. 06/27/2021 9:59:00 pm)https://github.com/opensearch-project/dashboards-reports/blob/e5174537800c60b1bf3145a80c4a36ab4227b80b/dashboards-reports/server/routes/utils/dataReportHelpers.ts#L173-L175
https://github.com/opensearch-project/dashboards-reports/blob/e5174537800c60b1bf3145a80c4a36ab4227b80b/dashboards-reports/server/routes/utils/constants.ts#L67
Notice is the first step above, we are cutting off the seconds and seconds fractions, comparing with what seems like the default date field format in advanced UI setting. And in step 2, the seconds fields will always be
00
, becuase of the cut off in step 1.Describe the solution you'd like
maybe cutting off seconds for date field is not a good choice. We have the following format as available options. Maybe we should use
date_hour_mintue_seconds
ordate_hour_minute_second_fraction
Describe alternatives you've considered
Retrieve date format setting from Advanced UI setting and use that, but I feel like this will not only apply to date format, but also other settings, such as csv seperator, timezone, url prefix, etc. It's better to add it as a compete feature to support advanced UI setting loading
Additional context
This issue was originally raised from Opensearch forum https://discuss.opendistrocommunity.dev/t/generating-csv-doesnt-include-seconds-on-timestemp-fields/6413/6
The text was updated successfully, but these errors were encountered: