easyui-datetimebox默认显示当前时间

墨蓝 2022-08-19 11:12 432阅读 0赞

1.html标签

  1. 开始日期:<input type="text" class="easyui-datetimebox" style="width:150px" id="kssj">
  2. 结束日期:<input type="text" class="easyui-datetimebox" style="width:150px" id="jssj">

2.js

  1. $(function()
  2. {
  3. var curr_time=new Date();
  4. var strDate=curr_time.getFullYear()+"-";
  5. strDate +=curr_time.getMonth()+1+"-";
  6. strDate +=curr_time.getDate()+"-";
  7. strDate +=" "+curr_time.getHours()+":";
  8. strDate +=curr_time.getMinutes()+":";
  9. strDate +=curr_time.getSeconds();
  10. $("#kssj").datetimebox("setValue",strDate);
  11. $("#jssj").datetimebox("setValue",strDate);
  12. });

发表评论

表情:
评论列表 (有 0 条评论,432人围观)

还没有评论,来说两句吧...

相关阅读

    相关 EasyUIdatetimebox使用

    前言   使用datetimebox时发现选中时间之后需要点击确定才能获得选中时间,感觉很麻烦,所以想要实现点击之后就可以获得选中时间。 代码 <inp