bootstrap datepicker显示默认日期 [英] bootstrap datepicker show default date selected

查看:418
本文介绍了bootstrap datepicker显示默认日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用引导日期标签,我是

最后:




Im using bootstrap datepicker and I'm applying the set date function.

ie.,

$('.datepicker').datepicker('setDate', new Date(2011, 2, 5));

This works fine but the date specified is not getting selected.

解决方案

After selecting the date using setDate method, you need to update the datepicker in order to get the selected date in datepicker.

Before:

$('#datepicker').datepicker('setDate', new Date(2011, 2, 5));
$('#datepicker').datepicker('update');  //update the bootstrap datepicker

JSFiddle

Finally:

这篇关于bootstrap datepicker显示默认日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆