Skip to content

Forms: get rid of jQuery for date picker #41081

Open
@simison

Description

@simison

Get rid of jQuery requirement for Jetpack Forms date field; it's a big library to load just to show a simple date picker.

Image

jQuery( function ( $ ) {
const $input = $( '.contact-form input.jp-contact-form-date' );
const dateFormat = $input.attr( 'data-format' ) || 'yy-mm-dd';
$input.datepicker( {
dateFormat,
constrainInput: false,
showOptions: { direction: 'down' },
} );
} );

We can then update the library to something more modern and more accessible as well.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions