Closed turbomam closed 1 year ago
And when presented with a slot whose LinkML range is datetime
, DH does not provide a datepicker
Hmm! It is important to sort this out! I'm looking at one of our LinkML specifications for "sample collection date" which is marked as range "date", and DH is providing the popup datapicker, and saving only as "YYYY-MM-DD", no timezone.
So can I see a slot definition for one of your date fields?
Now I wouldn't be surprised if DH is using the "date" widget for managing datetime fields, but I'll have to double check that. I do recall the issue that DH wasn't showing a time picker for datetime fields, but rather was just defaulting to midnight local time. That needs to be improved.
I see DH has a parser in /lib/utils/validation.js (and UI calendar control) for "date" (xsd:date), but doesn't have one for "time" (xsd:time) and "datetime" (xsd:datetime) fields. It doesn't supply calendar widget for datetime.
@pkalita-lbl DH saves the date-ranged values as YYYY-MM-DD strings at lest in TSV and maybe all other formats. It looks like it's only the JSON output that casts it to a datetime
Okay I think we're talking about two totally separate things here which is making this issue confusing.
1) How should DataHarmonizer map types to input controls? Handsontable provides a date cell type. We currently utilize that when the range is date
. Handsontable also provides a time cell type which we could use when the range is time
. I'm not seeing any way to tell Handsontable to show a combined date + time cell type without resorting to custom cell types. So maybe we're out of luck there.
2) When DataHarmonizer exports to JSON it's doing a totally naive serialization. This causes Date
objects to be serialized as ISO formatted strings. However this isn't compatible with the date format that JSON Schema (which underpins most LinkML validation tools outside of DataHarmonizer) expects.
2 is just a fixable bug and I can use this issue to track fixing it. 1 is more of an open-ended discussion and we should open a different issue if we want to talk about that.
I shouldn't have implied that implementing a date+time widget is important to me.
Thing 2, saving values from a date-range column in JSON so that they validate against LinkML JSON schema, is much more important.
I have created a separate issue for having dh implement a time and a datetime datatype: https://github.com/cidgoh/DataHarmonizer/issues/391
see