jquery datepicker only month and year

Solutions on MaxInterview for jquery datepicker only month and year by the best coders in the world

showing results for - "jquery datepicker only month and year"
Sara
10 Feb 2016
1    dateFormat: 'MM yy',
2    changeMonth: true,
3    changeYear: true,
4    showButtonPanel: true,
5    onClose: function (dateText, inst) {
6        var isDonePressed = inst.dpDiv.find('.ui-datepicker-close').hasClass('ui-state-hover');
7        if (!isDonePressed)
8            return;
9
10        var month = inst.dpDiv.find('.ui-datepicker-month').find(':selected').val(),
11            year = inst.dpDiv.find('.ui-datepicker-year').find(':selected').val();
12
13        $(this).datepicker('setDate', new Date(year, month, 1)).change();
14        $('.date-picker').focusout();
15    },
16    beforeShow: function (input, inst) {
17        var $this = $(this),
18            // For the simplicity we suppose the dateFormat will be always without the day part, so we
19            // manually add it since the $.datepicker.parseDate will throw if the date string doesn't contain the day part
20            dateFormat = 'd ' + $this.datepicker('option', 'dateFormat'),
21            date;
22
23        try {
24            date = $.datepicker.parseDate(dateFormat, '1 ' + $this.val());
25        } catch (ex) {
26            return;
27        }
28
29        $this.datepicker('option', 'defaultDate', date);
30        $this.datepicker('setDate', date);
31
32        inst.dpDiv.addClass('datepicker-month-year');
33    }
34});
35And everything else you need is the following CSS somewhere around:
36
37.datepicker-month-year .ui-datepicker-calendar {
38    display: none;
39}
40
41// And everything else you need is the following CSS somewhere around:
42
43.datepicker-month-year .ui-datepicker-calendar {
44    display: none;
45}
queries leading to this page
datepicker month and year onlyshow only current month in datepickerdatepicker only ine monthjquery datepicker with month and year selectionjquery year month pickerjquery datepicker only month and yeardatepicker jquery select month and yeardatepicker show only current month datesonly month and year datepickerdatepicker only for monthsjquery datepicker get available dates in current monthdatepicker show only monthonly month and year datepicker jquerydate getday of month in jquery datepickerhow to get only month in html datepickerjquery month picker without yeardatepicker select month and year onlyjquery date picker only month and yeardatepicker for the month onlyjquery ui datepicker show only month yearjs datepicker month onlyjquery datepicker only show month and yeardatepicker with only month and yearjquery get month and year from datedatepicker select only monthdatepicker to show only monthsjquery datepicker month and year onlydatetimepicker only show month and yearjquery datepicker current month and beyonddatepicker select only month and yearjquery datepicker select month and yearhow to show only month in datepickerget month from date using jqueryjquery datepicker format month and year onlyonly month and year default datepicker javascriptdatepicker calendar year month onlydatepicker only show month and yeardate month year showin jquery datepicker datetimepicker month and year onlydatepicker show only current monthshow only month in jquery ui datepickerstart date current month in datepicker using jqueryjquery ui datepicker show only year and monthjquery datepicker year month selectionjquery ui datepicker only month and yearhow to show only month and year in datepickershow only months and year in jquery ui datepickerdatepicker day and month onlydatepicker month and year only jquerydatepicker only month and yeardatepicker month and year onlydatepicker only month and year javascriptselect only month and year in datepickerjquery datepicker only monthsmonth and year datepickerdatetimepicker only month and yeardatepicker month onlyhow to display only year month and day in datepickerjquery datepicker only month and year in excelonly month and year datepicker javascriptjquery month year pickerdate select js only month and yeardatepicker only monthonly month picker in jquerydatetimepicker show month and year onlyget month from date to date jqueryjquery datepicker only show current monthjquery datepicker current monthdatepicker to select only month and yeardatepicker for month and year onlyshow only minimum month today date in datepickershow only current month dates in datepickerjquery datepicker only month and year