ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.48k stars 1.04k forks source link

EOMONTH() produces different results than MS Excel #2714

Closed brandon-avantus closed 1 month ago

brandon-avantus commented 2 months ago

This issue is unique.

Operating System

Linux (DEB package)

Version information

8.0.1.31

Expected Behavior

Entering the formula =EOMONTH(DATE(2028, 1, 1), -3) in MS Excel produces the expected date 10/31/2027 (or the integer 46691). I would expect the same from ONLYOFFICE.

Actual Behavior

Entering the same formula in an ONLYOFFICE spreadsheet produces the date 10/30/2027 (or the integer 46690), which is one day earlier than expected. I tried this with other dates as the first parameter and other negative months as the second parameter with similar results: the second-to-last day is returned instead of the last day.

Reproduction Steps

  1. Create a new ONLYOFFICE spreadsheet
  2. In any cell, enter the formula =EOMONTH(DATE(2028, 1, 1), -3)
  3. Set the cell format to Short Date

Additional information

See the official MS EOMONTH documentation.

Note: I am using the Flatpak version of ONLYOFFICE Desktop Editors from flathub, not the DEB package as indicated; there is no option for Flatpak in the OS list.

rsnegirev commented 2 months ago

Hi @brandon-avantus

What regional settings do you use?

brandon-avantus commented 1 month ago

What regional settings do you use?

image

Also,

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
rsnegirev commented 1 month ago

Sorry for a long answer, @brandon-avantus.

What is your GMT zone?

brandon-avantus commented 1 month ago

What is your GMT zone?

$ cat /etc/timezone
America/Los_Angeles

@rsnegirev current GMT adjustment, due to daylight saving time, it is -0700 (US PDT).

rsnegirev commented 1 month ago

@brandon-avantus sorry for a long answer.

The problem was fixed in this commit: https://github.com/ONLYOFFICE/sdkjs/commit/b1eb1bb21d6fa25489ba56fdf17cc3632d073661

Fixes will be released in the next major version.

And we're moving this issue to DocumentServer repo, since it's our base product and problem actual there too.

Thank you for the report!

brandon-avantus commented 1 month ago

Thank you for the quick fix!