Programing/JQUERY

DatePicker 기본 설정

한설림 2017. 5. 25. 11:07



$("._datePicker").datepicker({

       prevText: '이전 달',

       nextText: '다음 달',

       monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],

       monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],

       dayNames: ['일', '월', '화', '수', '목', '금', '토'],

       dayNamesShort: ['일', '월', '화', '수', '목', '금', '토'],

       dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],

    // showMonthAfterYear: true,

    yearSuffix: '년',

    showOn: "button",

        buttonImage: "img/calendar.gif",

        buttonImageOnly: true,

        buttonText: "Select date",

    regional        : 'ko',

        autoSize        : true,

        changeMonth    : true,

        changeYear : true ,

        altFormat       : 'yy-mm-dd',

        dateFormat      : 'yy-mm-dd',

        showButtonPanel : true,

        beforeShow: function() {

          setTimeout(function() {

              $("#ui-datepicker-div").before(

                "<iframe id='ui-datepicker-div-bg-iframe' frameborder='0' scrolling='no' style='filter:alpha(opacity=0); position:absolute;"

                  + "left: " + $("#ui-datepicker-div").css("left") + ";"

                  + "top: " + $("#ui-datepicker-div").css("top") + ";"

                  + "width: " + $("#ui-datepicker-div").outerWidth(true) + "px;"

                  + "height: " + $("#ui-datepicker-div").outerHeight(true) + "px;'></iframe>");

          }, 20);

        },

        onSelect  : function(  dateText, inst ) {

          $(this).removeClass('placeholdersjs');

        },

        onClose: function() {

            clearPlaceholder();

          $("#ui-datepicker-div-bg-iframe").remove();

        }

    });



<input class="_datePicker " id="searchDate" name="searchDate" placeholder="Date" >