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

Use native HTML5 date fields in the admin section #4111

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

javierm
Copy link
Member

@javierm javierm commented Aug 27, 2020

References

Background

We've had to add a couple of hacks in order to make jQuery UI datepicker work with Turbolinks, and one of our tests is failing because the datepicker changes its height when changing from a month with 5 weeks to a month with 6 weeks and makes it impossible to click a chekbox.

Furthermore we were using a date format of date/month/year, which is confusing for users living in countries where month/date/year is used.

The datepicker changes height when selecting August 2020 and the checkbox to enable a process cannot be selected anymore

Objectives

  • Use a date format familiar to users
  • Fix an issue with the datepicker covering other fields
  • Improve usability for mobile users when selecting dates
  • Improve keyboard accessibility when selecting dates
  • Simplify the code dealing with date formats

Notes

Since date fields are not supported in Safari and Internet Explorer, we're still using the jQuery UI datepicker on those browsers (and on any other browser not supporting date fields).

@javierm javierm self-assigned this Aug 27, 2020
@javierm javierm added this to Reviewing in Consul Democracy via automation Aug 27, 2020
@javierm javierm force-pushed the remove_admin_datepicker branch 2 times, most recently from c1f8cf8 to a37f0a6 Compare August 27, 2020 20:26
We've had to add a couple of hacks in order to make jQuery UI datepicker
work with Turbolinks, and one of our tests is failing because the
datepicker changes its height when changing from a month with 5 weeks to
a month with 6 weeks.

We could add a workaround so the test still passes (jQuery UI doesn't
provide a configuration option to always displays 6 weeks in the
datepicker), but I think it's easier to just use the HTML5 native date
input field, which also allows us to simplify the code a bit and IMHO it
improves the user experience, particularly when using mobile phones.

Since date fields are not supported in Safari and Internet Explorer,
we're still using the jQuery UI datepicker on those browsers (and on any
other browser not supporting date fields).

Due to these changes, we're moving the tests checking datepicker's
behaviour to the dashboard. I've choosing not to change the public pages
because I'm not 100% sure everybody would like this change (some people
prefer the datepicker because we can configure the way it looks).
Copy link
Member

@Senen Senen left a comment

Choose a reason for hiding this comment

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

👏

Consul Democracy automation moved this from Reviewing to Testing Aug 28, 2020
Now we have a file named 'datepicker.js' it should be easier to
have all code related to datepicker plugin within the same file.
@javierm javierm merged commit 8e38838 into master Aug 28, 2020
Consul Democracy automation moved this from Testing to Release 1.2.0 Aug 28, 2020
@javierm javierm deleted the remove_admin_datepicker branch August 28, 2020 12:34
@javierm javierm removed the 1.2 label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants