datepicker 设置默认日期的方法

1.属性初始化设置

$('#startTime').datepicker({
rtl: App.isRTL(),
orientation: "right",
format: 'yyyy-mm-dd',
language: 'zh-CN',
todayBtn: true,
todayHighlight: true,
autoclose: true ,
viewDate:new Date() //也可以通过function函数获得值
});

2.通过属性设置

$('#startTime').datepicker("setViewDate",new Date());

猜你喜欢

转载自www.cnblogs.com/SHZX/p/10212973.html