Skip to content
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

Merged
merged 6 commits into from
Aug 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,19 @@ export class PortfolioOverviewCommands extends Component<
this.setState({ isExporting: true })
try {
const { fltItems, fltColumns, selectedItems } = this.props
const items = isArray(selectedItems) && selectedItems.length > 0 ? selectedItems : fltItems

let items = isArray(selectedItems) && selectedItems.length > 0 ? selectedItems : fltItems

items = items.map((item) => {
if (item.GtStartDateOWSDATE !== undefined) {
item.GtStartDateOWSDATE = new Date(item.GtStartDateOWSDATE)
}
if (item.GtEndDateOWSDATE !== undefined) {
item.GtEndDateOWSDATE = new Date(item.GtEndDateOWSDATE)
}
return item
})

await ExcelExportService.export(items, fltColumns)
this.setState({ isExporting: false })
} catch (error) {
Expand Down