Menu

#384 Excel date format

v2.7
closed-fixed
None
5
2023-09-15
2021-09-22
No

Exporting the WBS to Excel gives dates as plain text in M/d/yyyy format. Because the values are exported as plain text, they aren't displayed in Excel using the default date format, and changing the date format of the cells has no effect. (I'm in a country that writes dates in the format day/month/year, but in my case, I'd prefer to use ISO 8601 anyway, i.e., YYYY-MM-DD.)

I note that there's this code in teamdash/src/teamdash/wbs/excel/WBSExcelWriter.java:

    if (unwrapped instanceof Date) {
        // POI-exported dates seem to freak Excel out for some reason.
        // to workaround, we export a string.
        Date date = (Date) unwrapped;
        text = DATE_FORMATTER.format(date);
        cell.setCellValue(new HSSFRichTextString(text));

    } else if (unwrapped instanceof NumericDataValue) {

and:

private static final DateFormat DATE_FORMATTER = new SimpleDateFormat(
        "M/d/yyyy");

Could you please have another look at this? Maybe Excel (and/or Apache POI) works better now than in 2008?

Richard.

Discussion

  • David Tuma

    David Tuma - 2021-09-23
    • assigned_to: David Tuma
     
  • David Tuma

    David Tuma - 2023-05-03
    • Group: Incoming --> Fix Available
     
  • David Tuma

    David Tuma - 2023-09-15
    • status: open --> closed-fixed
    • Group: Fix Available --> v2.7
     
  • David Tuma

    David Tuma - 2023-09-15

    Fixed in Process Dashboard version 2.7

     

Log in to post a comment.