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

Add support for datetime, time and date inputs #2002

Merged
merged 9 commits into from
Jul 3, 2023

Conversation

jannikbecher
Copy link
Contributor

No description provided.

@jannikbecher
Copy link
Contributor Author

@github-actions
Copy link

github-actions bot commented Jun 21, 2023

Uffizzi Preview deployment-29154 was deleted.

lib/livebook_web/live/output/input_component.ex Outdated Show resolved Hide resolved
lib/livebook_web/live/output/input_component.ex Outdated Show resolved Hide resolved
end

defp parse(html_value, %{type: :date}) do
case Date.from_iso8601(html_value) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't specify milliseconds in the input, so I think we should make sure we parse into datetime with second precision.

lib/livebook_web/live/output/input_component.ex Outdated Show resolved Hide resolved
assets/js/hooks/utc_date_time_input.js Outdated Show resolved Hide resolved
@jonatanklosko
Copy link
Member

@jannikbecher thanks for the PR, I dropped a couple comments on both PRs on the overall API :)

@jannikbecher
Copy link
Contributor Author

jannikbecher commented Jun 30, 2023

@jonatanklosko thank you for the review! I hope I implemented your suggestions correctly :)

Can you give me a hint how to test the implemented behavior?

@jonatanklosko
Copy link
Member

Can you give me a hint how to test the implemented behavior?

We have some tests here, though in this case most of the logic is in the hook, so probably not much to LV test.

@jonatanklosko jonatanklosko changed the title Add Kino input for datetime, time, date, week and month Add support for datetime, time and date inputs Jul 3, 2023
@jonatanklosko
Copy link
Member

jonatanklosko commented Jul 3, 2023

@jannikbecher thank you! I made a few adjustments to make it clear the values are UTC and the user enters in local time zone, it's ready to go :D

@jonatanklosko jonatanklosko merged commit 649a556 into livebook-dev:main Jul 3, 2023
7 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants