bootstrap的datetimepicker時分秒 設爲00:00:00

先上圖片(看效果)
clipboard.png
clipboard.pnggit

今天遇到一個需求,須要選擇日期的時候 時分秒都要爲00:00:00
$(".form_datetime").datetimepicker({format: 'yyyy-mm-dd 00:00:00 ',minView:2,language:'zh-CN'});
當時這種寫法並很差用
本身改了一下插件(實現效果以下)
$(".form_datetime").datetimepicker({format: 'yyyy-mm-dd 00:00:ll',minView:2,language:'zh-CN'});github

須要支持中文的須要修改 $.fn.datetimepicker.Constructor = Datetimepicker; 須要改爲下面的效果。
$.fn.datetimepicker.Constructor = Datetimepicker;bootstrap

var dates = $.fn.datetimepicker.dates = {
    en: {
        days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
        daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
        months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
        monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        meridiem: ["am", "pm"],
        suffix: ["st", "nd", "rd", "th"],
        today: "Today"
    },
    'zh-CN':{
        days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
        daysShort: ["週日", "週一", "週二", "週三", "週四", "週五", "週六", "週日"],
        daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
        months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
        monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
        today: "今日",
        suffix: [],
        meridiem: []
    }
};

須要下載地址:
https://github.com/308626712/...spa

相關文章
相關標籤/搜索