在 jQuery 日期选择器中更改月份和年份之间的位置

Change position between month and year in jQuery datepicker

我在 link 下面用日期选择器制作了 'month calendar'。 当我单击按钮时,日历出现并显示 。这是我的问题。有人知道如何更改此顺序吗?

1.month2.year1.year2.month

http://develop-for-fun.blogspot.kr/2013/08/jquery-ui-datepicker-month-and-year.html

        $(function () {
            $('#MainContent_txtMonth').datepicker({
                changeYear: true,
                changeMonth: true,
                showButtonPanel: true,
                dateFormat: 'yy-mm',
                monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
                showOn: "button",
                buttonImage: "img/button_calendar.jpg",
                buttonImageOnly: true
                }).focus(function() {
                var thisCalendar = $(this);
                $('.ui-datepicker-calendar').detach();
                $('.ui-datepicker-close').click(function () {
                var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
                var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
                thisCalendar.datepicker('setDate', new Date(year, month, 1));
                });
            });
        });

您不必修改 jquery ui 源代码。我刚刚找到了一个可以满足您要求的选项。

showMonthAfterYear:true,

用法示例:

$( "#datepicker" ).datepicker({
        changeMonth: true,
        changeYear: true,
        showButtonPanel: true,
        showMonthAfterYear:true,
        dateFormat: 'MM yy',
      });