Meta Box date picker doesn't go back far enough.

Support Meta Box AIO Meta Box date picker doesn't go back far enough.Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33142
    John ChvatalJohn Chvatal
    Participant

    I am working on an aviation hall of fame website and would like to use the date picker field type for listing people's birth date. Some inductee birth dates are prior to 1922. It appears Meta Box only goes back 100 years. Is this something that could be fixed?

    #33149
    Long NguyenLong Nguyen
    Moderator

    Hi John,

    You can use the setting js_options to change the yearRange, for example

    'fields' => [
        [
            'name'       => __( 'Date', 'your-text-domain' ),
            'id'         => $prefix . 'date_9m5vr96jdte',
            'type'       => 'date',
            'js_options' => [
                'yearRange' => '1800:2022',
            ],
        ],
    ]

    In the builder: https://share.getcloudapp.com/E0uobjQ5

    Refer to the documentation https://docs.metabox.io/fields/date/#settings
    https://api.jqueryui.com/datepicker/#option-yearRange

    #33167
    John ChvatalJohn Chvatal
    Participant

    Thank you Long! This worked like a charm!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.