Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime picker #53

Open
NduatiK opened this issue Apr 30, 2021 · 5 comments
Open

Datetime picker #53

NduatiK opened this issue Apr 30, 2021 · 5 comments

Comments

@NduatiK
Copy link
Contributor

NduatiK commented Apr 30, 2021

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:

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?

@edisonywh
Copy link
Owner

edisonywh commented Apr 30, 2021

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!

@NduatiK
Copy link
Contributor Author

NduatiK commented Apr 30, 2021

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.

@NduatiK
Copy link
Contributor Author

NduatiK commented Apr 30, 2021

By the way, I've been busy with some things lately, I'll get to review & reply your other comments soon!

No problem

@edisonywh
Copy link
Owner

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

@NduatiK
Copy link
Contributor Author

NduatiK commented May 3, 2021

🤦🏽‍♂️ Its obvious that we don't need one now.
I'm not sure what I was going for. I agree - no timezone field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants