Custom Date Format for Bootstrap-DatePicker

前端 未结 4 476
生来不讨喜
生来不讨喜 2020-12-29 05:48

Can anyone guide me for formatting date in Bootstrap-DatePicker.

And I used Eternicode/bootstrap-datepicker. Here my codes at JSP..



        
4条回答
  •  别那么骄傲
    2020-12-29 06:07

    I solve it editing the file bootstrap-datapicker.js.

    Look for the text bellow in the file and edit the variable "Format:"

    var defaults = $.fn.datepicker.defaults = {
        assumeNearbyYear: false,
        autoclose: false,
        beforeShowDay: $.noop,
        beforeShowMonth: $.noop,
        beforeShowYear: $.noop,
        beforeShowDecade: $.noop,
        beforeShowCentury: $.noop,
        calendarWeeks: false,
        clearBtn: false,
        toggleActive: false,
        daysOfWeekDisabled: [],
        daysOfWeekHighlighted: [],
        datesDisabled: [],
        endDate: Infinity,
        forceParse: true,
        format: 'dd/mm/yyyy',
        keyboardNavigation: true,
        language: 'en',
        minViewMode: 0,
        maxViewMode: 4,
        multidate: false,
        multidateSeparator: ',',
        orientation: "auto",
        rtl: false,
        startDate: -Infinity,
        startView: 0,
        todayBtn: false,
        todayHighlight: false,
        weekStart: 0,
        disableTouchKeyboard: false,
        enableOnReadonly: true,
        showOnFocus: true,
        zIndexOffset: 10,
        container: 'body',
        immediateUpdates: false,
        title: '',
        templates: {
            leftArrow: '«',
            rightArrow: '»'
        }
    };
    

提交回复
热议问题