Skip to content

Why does excel not format time portion of date? #11696

Description

@Eralmidia

Question

This question is related to dates in grids and the excel exporter. We used to simply keep our dates as iso8601 strings and format them with a pipe in the cell template. But as we are now starting to utilize the Excel style filter in the grid, it is beneficial to convert the strings to actual date object in the underlying data, in order to get the correct filtering options (this week, last month etc).

Another issue we had before converting to date, is that Excel in fact doesn't seem to recognize the iso8601 standard as a date, resulting in Excel treating it as plain text. Converting to date and using the Igx Excel exporter do result in dates, but for some reason it chooses a format which only shows the date and not time component. For instance, we have the following grid:

image

The data are date objects, the type of the column is date, and the filter recognizes it as a date:
image

However, when we export this to excel, it looks like this:
image

The time component is there, but the format chosen by excel was

image

Note: we have our own toolbar for the grid, and our current export code looks like this:
image

Is there anything which can be done about this? Its quite cumbersome for our customers to manually have to change the formatting of every date coulmn for every export.

  • igniteui-angular version: 12.3
  • browser: Chrome latest

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions