Skip to content

Reading data formatted as date always returns numbers #47

@demontiejr

Description

@demontiejr

Hi,

I'm trying to use the library to process very large files and they contain date columns. When reading the values, I'm always getting numbers (the underlying numeric value for the date). Since I don't know in advance what's the data type for a particular column, I'd like to be able to identify it from the formatting.

I tried using cell.Type() == types.CellTypeDate() to decide whether I could explicitly get the value parsed to Time (with the Date function) but it's always returning false. I then tried to get the style ID and use the style sheet to get the info and check whether it's a date, but then I saw that this method is not implemented.

xlsx/style_sheet.go

Lines 214 to 227 in 4538b54

func (ss *styleSheet) resolveDirectStyle(id ml.DirectStyleID) *styles.Info {
if id == 0 {
return nil
}
panic(errorNotSupported)
//cellStyle := ss.ml.CellXfs.Items[id]
//style := &styles.Info{}
//_ = cellStyle
//TODO: Populate format.Info with required information
//return style
}

Is there a way I can identify dates right now? If not, can you point me to how I can solve this issue so I can send a pull request?

Thanks,
Demontiê

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions