cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 23 forks source link

Unified date, time, and datetime input widgets #395

Closed pkalita-lbl closed 1 year ago

pkalita-lbl commented 1 year ago
pkalita-lbl commented 1 year ago

@ddooley I've had a little time to work on #391 here and there over the last week or two. Here's some in-progress work that might be worth checking out. The goal here is to unify the input of dates, times, and datetimes.

I ended up using the flatpickr library to render date, time, and datetime pickers. I initially tried to use the native <input> types, but I had forgotten how limiting those are in terms of display formatting. I think flatpickr is a good alternative because it's widely used, actively maintained, and has no external dependencies. The flatpickr setup is contained in a set of custom cell editors.

Implementing custom cell editors is a bit complex, and I'm not 100% sure I got all of the details exactly right. If you have time to checkout this branch and test it locally I'd appreciate it. I've added a small test schema for convenience (which I'll remove if/when we're ready to go forward with this).

pkalita-lbl commented 1 year ago

@ddooley I think this read for review now. Please let me know if you'd like me to walk you through any of it!