roo-rb / roo

Roo provides an interface to spreadsheets of several sorts.
MIT License
2.78k stars 501 forks source link

Excel can store dates in exponent form which causes dates to incorrectly parse to year 1900 #583

Open synth opened 1 year ago

synth commented 1 year ago

Issue

We are parsing a customer's sheet that is returning some dates in an exponential form. Eg, "4.49e4" whereas successful date parses have the form "44221.0". When a date value is returned in this exponential form, the date is parsed to a date with year 1900.

Is this expected and is this something that Roo should account for? Or is this something that should be handled at the application layer.

Steps to reproduce

I don't have a concrete way to reproduce this yet, but I can work on this following some discussion if its warranted.

System configuration

Roo version: Tested in Roo 2.6.0 and 2.10.0

Ruby version: 2.7.5