bootstrap-datapicker

罗晨
2023-12-01

年月:

<div class="input-wrapper">
    <input class="edit" :disabled="!isEdit" name="reportStartDate" id="time" autocomplete="off"/>
</div>
//实例化时间控件
$("#time").datepicker({
    todayHighlight: true,// 当前时间高亮显示
    autoclose: 'true',// 选择时间后弹框自动消失
    format: 'yyyy-mm',// 时间格式
    language: 'zh-CN',// 汉化
    // todayBtn:"linked",//显示今天 按钮
    clearBtn: false,// 清除按钮,和今天 按钮只能显示一个
    startView:1,
    minViewMode:1
})

 

年月日:

<div class="input-wrapper">
    <input class="edit" :disabled="!isEdit" name="reportStartDate" id="time" autocomplete="off"/>
</div>
//实例化时间控件
$("#time").datepicker({
    todayHighlight: true,// 当前时间高亮显示
    autoclose: 'true',// 选择时间后弹框自动消失
    format: 'yyyy-mm-dd',// 时间格式
    language: 'zh-CN',// 汉化
    // todayBtn:"linked",//显示今天 按钮
    clearBtn: false,// 清除按钮,和今天 按钮只能显示一个
})

年:

<div class="input-wrapper"> <input class="edit" :disabled="!isEdit" name="reportStartDate" id="time" autocomplete="off"/> </div>

$("#time1").datepicker({
    todayHighlight: true,// 当前时间高亮显示
    autoclose: 'true',// 选择时间后弹框自动消失
    format: 'yyyy',// 时间格式
    language: 'zh-CN',// 汉化
    // todayBtn:"linked",//显示今天 按钮
    clearBtn: false,// 清除按钮,和今天 按钮只能显示一个
    startView: 2,
    minViewMode: 2,
    maxViewMode: 2
})

月:

<div class="input-wrapper"> <input class="edit" :disabled="!isEdit" name="reportStartDate" id="time" autocomplete="off"/> </div>

$("#time2").datepicker({
    todayHighlight: true,// 当前时间高亮显示
    autoclose: 'true',// 选择时间后弹框自动消失
    format: 'mm',// 时间格式
    language: 'zh-CN',// 汉化
    // todayBtn:"linked",//显示今天 按钮
    clearBtn: false,// 清除按钮,和今天 按钮只能显示一个
    startView: 1,
    minViewMode: 1,
    maxViewMode: 1
})
 类似资料: