rawgraphs / rawgraphs-app

A web interface to create custom vector-based visualizations on top of RAWGraphs core
https://rawgraphs.io
Apache License 2.0
8.66k stars 1.84k forks source link

Data Parsing Option: Date Format #263

Open FajrAlim opened 3 years ago

FajrAlim commented 3 years ago

In which part of the interface would this feature applies? [ ] 1. Load your data

Is your feature request related to a problem? Please describe. Hello! this is the first time I'm visiting this web, I'd like to ask regarding the Date Format in my data, it is: 2000-08-28T19:29:32.330Z my date format is in UTC -ISO 8601 (MSDN datetime formats)-, while in the Rawgraph has the closest Date format: YYYY-MM-DDTHH:mm:ss without Z, so is there any way to use the date format without find and replace it?

Describe the solution you'd like Adding Date Format: YYYY-MM-DDTHH:mm:ssZ

bianchimro commented 3 years ago

Hi @DawnBrawn, We'll add the format to the ones featured, thanks for the suggestion.

gnorbsl commented 3 years ago

Why not add an option to allow your own format instead of adding dozens?

xjchrist commented 3 years ago

another missing format is “2021-05-10T03:51:38.923Z" (decimal point seconds) which is Is not recognized and has to be manually edited to remove the decimal to “2021-05-10T03:51:38” before your software recognizes. I have a script I wrote to do this for me which is fairly annoying for the 300+ data points I currently have, but this could be easily avoided. Can seconds and/or fractions of a second format be added to RawGraphs please?

RenHoekNL commented 3 years ago

I'm testing out this library and my timestamps are in 'seconds since epoch'. Would be nice to also include that.

jwyg commented 2 years ago

Hello! Just adding to this - another argument in favour of adding support for the YYYY-MM-DDTHH:MM:SSZ date format is that this is the default of OpenRefine:

ISO-8601-compliant extended format with time in UTC: YYYY-MM-DDTHH:MM:SSZ.

I don't know if this has been discussed yet but would always be happy to see workflows and integrations to make Raw Graphs work well with OpenRefine. :-)

georg-d commented 12 months ago

https://rawgraphs.github.io/rawgraphs-core/docs/data-parsing currently tells

The function inferTypes limits its search for data types to numbers with . as decimal separator, dates and datetimes in ISO format, but doesn't explore all the possible date formats and formatting options.

but some ISO variations are obviously not yet accepted. From experiments I did, I guess rawgraphs.io can neither process a second's fraction (neither in milliseconds nor nanoseconds precision) nor a time zone information.

At https://en.wikipedia.org/wiki/ISO_8601 I read

dates YYYY-MM-DD times hh:mm:ss.sss Time zone designators +[hh]:[mm] Combined date and time representations T

So I'd expect e.g. 2023-10-03T15:34:26.4460520+02:00 is accepted. Fractions as well as time zone information are produced by many wide spread languages/platforms; e.g. my example was created by Windows PowerShell command get-date -Format o so mostly every Windows PC can produce such data. I am tech savy enough I can help myself (understand the issue and adapt my data by loading CSV in Notepad++ and doing a block selection with ALT+Drag+Drop of all fraction and timezone then deleting selected text), but many users won't be able to tackle down the issue and would be stuck unless inferTypes was able to recognize ISO timestamps including fractions and/or time zones.

An example file, created by reading a Shelly Plug S via REST using PowerShell: example power shell output.txt

mikima commented 9 months ago

RAWGraphs relies on https://d3js.org/d3-time-format for data handling. in rawgraphs-core, the function dateFormats handles the reading of formats. I think it should be possible to add new parsers (e.g. YYYY-MM-DDTHH:MM:SSZ) here: https://github.com/rawgraphs/rawgraphs-core/blob/master/src/dateFormats.js#L93

@bianchimro what do you think?