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

dev/accessiblity#3 Add aria-label to datepicker element #12208

Merged
merged 1 commit into from
May 25, 2018

Conversation

monishdeb
Copy link
Member

@monishdeb monishdeb commented May 25, 2018

Overview

This PR adds aria-label attribute to datepicker date and time field.

Before

test-multiple-before

After

screen shot 2018-05-25 at 6 01 58 pm

Technical Details

As per the datepicker enhancment, aria-label will be added to the date field if provided in attribute:

$this->add(
  'datepicker',
  'field_2',
  ts('Date Field'),
  array(
    'class' => 'some-css-class',
    'aria-label' => ts('Date field'), // optional if label is present
    'time-placeholder' => ts('Time'), // optional
  ),
  TRUE,
  array('time' => FALSE, 'date' => 'mm-dd-yy', 'minDate' => '2000-01-01')
);

Whereas time field uses the placeholder.

@colemanw
Copy link
Member

Excellent little improvement. Thanks Monish.

@colemanw colemanw merged commit 78ce089 into civicrm:master May 25, 2018
@monishdeb monishdeb deleted the access-3-datepicker branch May 25, 2018 17:22
@monishdeb
Copy link
Member Author

Thanks @colemanw

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.

3 participants