Open NduatiK opened 3 years ago
Tailwind is just the CSS portion, from the example you shared, the first one seems to re-implement the datepicker UI, the second one uses pikaday, and not sure about the 3rd one, maybe it's pure Vue? We're definitely not going to go implement Vue for just a small part like this though, so most likely we'd need a pure JS implementation like flatpickr/pikaday.
I'm not sure why UTC vs local timezone matters, we only support whatever Ecto does, or do you mean that maybe sometimes people want to store in UTC but display in local? (Now that I'm typing it, this does seem like a potential use case).
Like you said though, this is probably not a super huge priority in the grand scheme of things, but it definitely be nice to have.
By the way, I've been busy with some things lately, I'll get to review & reply your other comments soon!
I'm not sure why UTC vs local timezone matters, we only support whatever Ecto does, or do you mean that maybe sometimes people want to store in UTC but display in local? (Now that I'm typing it, this does seem like a potential use case).
I was thinking of :naive_datetime that ignores timezones. If a user puts in today's date at 3pm, I imagine in that case we would want to store the exact time put in and not one offset by their timezone.
By the way, I've been busy with some things lately, I'll get to review & reply your other comments soon!
No problem
I was thinking of :naive_datetime that ignores timezones. If a user puts in today's date at 3pm, I imagine in that case we would want to store the exact time put in and not one offset by their timezone.
Exactly, so I don't really see how that matters, we don't need a timezone field in the datepicker
🤦🏽♂️ Its obvious that we don't need one now. I'm not sure what I was going for. I agree - no timezone field.
Hi @edisonywh,
Are there any plans implement a datetime picker for Ecto date and time types (
:utc_datetime
,:naive_datetime
,:date
,:time
,:any
,:utc_datetime_usec
,:naive_datetime_usec
,:time_usec
)?According to Mozilla's browser documentation,
text=[datetime-local]
is not fully supported.. This makes me think we would need a cross browser (read custom) implementation for a consistent experience.What do you think of using an existing tailwind implementation? Here are some I found:
https://tailwindcomponents.com/component/datepicker-with-tailwindcss-and-alpinejs (incomplete can't change years)
https://tailwindcomponents.com/component/invoice-generator-build-with-tailwindcss-and-alpinejs (has no timepicker)
https://www.vue-tailwind.com/docs/datepicker/ - this is a vue implementation but represents an ideal case. (Disable inline and enable timepicker for the best results (stuck in vueland)
Does it even have to be a tailwind datepicker?
I think we can ignore the lack of time pickers as most people will have no trouble typing them in (default to the current time?) but will benefit from not having to type in dates using the ISO format.
Things become tricky when we have to handle UTC vs local timezone so maybe placing a dropdown with UTC vs local might be of value.
What do you think?