marcelle icon indicating copy to clipboard operation
marcelle copied to clipboard

Trailing integer in text data interpreted as Date in DatasetTable

Open cy-moi opened this issue 3 years ago • 0 comments

Describe the bug I was trying to display some data with datasetTable and found that some of the texts were interpreted as Date. For example, 1 is interpreted as a Date and reformat to about 22 years ago

To Reproduce Steps to reproduce the behavior:

  1. Follow examples to initialize dataset and datasetTable variables
  2. Have some entries with integers or entries ending with an integer, ie. 1, sample 1, etc.
  3. use dataset.create() to append the data as in object format, ie.{entry: '1'}
  4. add the table on dashboards with use()
  5. See 1 -> about 22 years ago

A simpler way to reproduce the behavior:

  1. open Iris-SKlearn example
  2. change Virginica to Virginica 1 or Setosa' to Setosa 1`
  3. load the data in the demo
  4. see Virginica 1 become about 22 years ago

Expected behavior It should display the original data as in the storage.

Actual behavior Integers in texts interpreted as Date Format Error in Console Does not match to data in Storage

Additional Information log in the console:

Date Parsing Error text data sample1 RangeError: Invalid time value
    at formatDistance3 (index.js:110:11)
    at formatDistanceToNow (index.js:92:10)
    at Array.formatDate (TableContentCell.svelte:18:16)
    at Object.p (TableContentCell.svelte:45:14)
    at Object.p (TableContentCell.svelte:57:5)
    at update (index.mjs:1191:36)
    at flush (index.mjs:1158:13)

Screenshots table appearances - actual data in localstorage after changing Setosa to Setosa 1 in Iris csv

cy-moi avatar Feb 17 '23 01:02 cy-moi