Skip to content

Can't get a consistent result when parsing dates #1324

@clasqui

Description

@clasqui

I'm trying to import a spreadsheet file, then convert it to json with the util XLSX.utils.sheet_to_json() to iterate through the rows.
I'm getting unexpected results when getting the value of a cell I know it's a date:

  • When the file is imported as xls, the dates show as m/d/yyyy
  • When the same file is imported as csv, the dates show as d/m/yyyy

In my file, using both file types, the dates show as dd/mm/yyyy and I'm using the following options when parsing the file and exporting the WB:

XLSX.utils.sheet_to_json(ws, {header:1, range: 1, dateNF: 'DD/MM/YYYY', cellText: false, raw: false});

I think this is a bug because you can get unexpected results from different inputs and there is no way to uniform it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions