bootstrap-datetimepicker选择年和月

$("#year").datetimepicker({
    format: 'yyyy',
    autoclose:true,
    startView:4,
    minView:4,
    maxView:4,
    initialDate:new Date(),
    language:'zh-CN'
}).on('changeDate', function(){
    var date = $("#year").val();
    getSaleCount(date);
}); 
$("#month").datetimepicker({
    format: 'mm',
    autoclose:true,
    startView:3,
    minView:3,
    maxView:3,
    initialDate:new Date(),
    language:'zh-CN'
}).on('changeDate', function(){
    var year = $("#year").val();
    var month = $("#month").val();
    var date = year + month;
    getSaleCount(date);
});

你可能感兴趣的:(插件)