-
Notifications
You must be signed in to change notification settings - Fork 16
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
Converting SP dates to readable excel date format #495
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.
Too hardcoded in my opinion. Only works for these two date fields. We should look into a more dynamic solution that works for all date fields, including custom ones.
I agree that it's not ideal. How about iterating over properties of the item, converting those ending with *OWSDATE to proper date values? |
We should have access to the columns array, where we have the column config and can catch if it's a date. |
I agree. Added a solution that iterates the columns and checks the field type. This should also convert any custom date values. |
Any input here @olemp ? Can this be merged? |
Still want to have a look through it. Should have time this week - tomorrow or Thu. |
Friendly reminder :) |
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.
Se comments.
const items = isArray(selectedItems) && selectedItems.length > 0 ? selectedItems : fltItems | ||
|
||
fltColumns.map((col) => { |
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.
@Rundez You're using Array.map
without returning anything. Seems like it's Array.forEach
you want to use here.
@olemp Changed map to foreach..... |
Tested OK |
Your checklist for this pull request
Description
When exporting project information with dates from "Porteføljeoversikt", the dates were not recognized by excel due to the format.
The solution: Convert the Sharepoint date format to a standard JS date object recognized by excel.
How to test
Relevant issues (if applicable)
fixes #487
💔Thank you!