Add a monthly datepicker with jQuery - separate script

This script adds a month-year picker to a text field, and works better than a modification of jQuery datepicker.

<?php
drupal_add_js
(drupal_get_path('module', 'jquery_ui') .'/jquery.ui/ui/jquery.mtz.monthpicker.js');

$sub_script = "$(document).ready(function () {
         $('.add-datepicker-y-m').monthpicker({
            'pattern': 'mm/yyyy'
          })
        }); "
;

drupal_add_js($script, 'inline', 'footer');
?>

Source: https://github.com/lucianocosta/jquery.mtz.monthpicker

Knowledge keywords: