Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalcCellValue does not handle dates #998

Closed
stanim opened this issue Aug 19, 2021 · 1 comment
Closed

CalcCellValue does not handle dates #998

stanim opened this issue Aug 19, 2021 · 1 comment
Labels
confirmed This issue can be reproduced

Comments

@stanim
Copy link
Contributor

stanim commented Aug 19, 2021

date.zip
Description

CalcCellValue treats dates as strings. As a consequence CalcCellValue is unable to process dates in formulas:

  • mathemical expressions give parsing error
  • comparison fails: "19-08-2021" > "20-07-2022", but should be the opposite

Steps to reproduce the issue:

  1. Download date.zip and unzip it
  2. Run the go file: go run ./date.go

Describe the results you received:

> go run ./date.go

date.xlsx
Sheet1!C2: error: strconv.ParseFloat: parsing "03/08/21": invalid syntax
Sheet1!C3: error: strconv.ParseFloat: parsing "19/08/21": invalid syntax

Describe the results you expected:

> go run ./date.go

date.xlsx
Sheet1!C2: sucess: "05-08-21"
Sheet1!C3: should be true: "true"

Output of go version:

go version go1.16.7 linux/amd64

Excelize version or commit ID:

> git log
commit a55f354eb3d0c6c1b9a543ff8ff98227aa6063a6 (HEAD -> lookup, origin/master, origin/HEAD, master)
Author: xuri <[email protected]>
Date:   Tue Aug 17 00:01:44 2021 +0800

    This closes #989, closes #990
    
    New API: `SetRowStyle` support for set style for the rows
    Update documentation for the `GetRows`, `SetCellStyle` and `SetColStyle`

Environment details (OS, Microsoft Excel™ version, physical, etc.):

  • OS: Archlinux 5.13.10-arch1-1
  • WPS Spreadsheets (version wps-office 11.1.0.10702-1)
  • LibreCalc (version libreoffice-fresh 7.1.5-2)
@xuri xuri added the confirmed This issue can be reproduced label Aug 23, 2021
@xuri xuri added the in progress Working in progress label Sep 4, 2021
@xuri xuri closed this as completed in 32b23ef Sep 5, 2021
@xuri xuri removed the in progress Working in progress label Sep 5, 2021
@xuri
Copy link
Member

xuri commented Sep 5, 2021

Thanks for your issue, I have added text comparison support, please try to upgrade to the master branch.

jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
- Support text comparison in the formula, also ref qax-os#65
- `GetCellValue`, `GetRows`, `GetCols`, `Rows` and `Cols` support to specify read cell with raw value, ref qax-os#621
- Add missing properties for the cell formula
- Update the unit test for the `CalcCellValue`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed This issue can be reproduced
Projects
None yet
Development

No branches or pull requests

2 participants