WHOIGit / ndsf-sealog-client

NDSF edition of the Sealog event logging web client
MIT License
4 stars 0 forks source link

Sealog/Seaplay Navigation Time Displayed is always YYYY.0 (i.e. 2023.0) #64

Open cgraver opened 1 year ago

cgraver commented 1 year ago

On Alvin Sealog and Seaplay, and on seaplay.whoi.edu for Jason and Alvin, "Time" within the Navigation box always displays "YYYY.0" with YYYY being the year of the cruise. This has persisted across all cruises I've gone through, back to 2020 at least.

cgraver commented 1 year ago

NavTime

rgov commented 1 year ago

Related to #61. The time field is stored like 2023-07-10T15:23:27.105Z. The solution in #62 was to run parseFloat() on the input and check if it is NaN. But, since the time field begins with a valid float (2023), this check doesn't work.

I think we should move to a different technique than using parseFloat(), such as a regular expression, /^[+-]?(?:\d*\.\d+|\d+\.\d*)$/. This only detects numbers with a decimal point (and excludes scientific notation).

(The root cause of this is that Sealog doesn't use typed data and everything is stored as a string.)