alanhay / html-exporter

Java Library to convert HTML/CSS to MS Excel and ODS Spreadhseets.
Apache License 2.0
35 stars 38 forks source link

Handle datetime value properly #27

Closed azlinrahim closed 1 year ago

azlinrahim commented 1 year ago

Currently, values that look like datetime e.g. '23/02/2023 - 03:24 PM' will be parsed as numeric value. This caused the resulting Excel to display erroneous data. For example, for datetime '23/02/2023 - 03:24PM', it will be shown as 2.0.

To fix this, we need to:

  1. Identify values that look like datetime.
  2. Use regex (or other methods) to extract a parseable datetime.
  3. Parse the datetime value.
  4. Set the cell value and also the corresponding datetime format.