Skip to content

Forms: get rid of jQuery for date picker #41081

Open
@simison

Description

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' },
} );
} );

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions