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
update csv export to include full date and time in 12 hour format #5922
update csv export to include full date and time in 12 hour format #5922
Conversation
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 is a breaking change so extra care should be considered. Maybe we need to see what the old export on the invoices page used to export first
modifyFields(srv.result.fields, data, 'amount', displayValue) | ||
modifyFields(srv.result.fields, data, 'datetime', v => v? moment(v).format('YYYY-MM-DD hh:mm:ss'): v); | ||
modifyFields(srv.result.fields, data, 'datetime', v => v ? moment(v).format("dddd, MMMM Do YYYY, h:mm:ss a"): v); |
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.
To not break the curent format I'd suggest to simply use proper ISO format with added timezone info, like this:
modifyFields(srv.result.fields, data, 'datetime', v => v ? moment(v).format("dddd, MMMM Do YYYY, h:mm:ss a"): v); | |
modifyFields(srv.result.fields, data, 'datetime', v => v ? (new Date(v)).toISOString().replace('T', ' ')); |
Not sure if v
is a Date
already, if so it could be v.toISOString()
.
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.
we shouldn't do string manipulations to format dates when we have a library to do things properly.
@TChukwuleta I think you only have to change |
Yea. done that @NicolasDorier. Excel export now in 24 hour format Thanks |
Resolves #5915