为什么angularjs bootstrap datepicker会在前一天选择? [英] Why does angularjs bootstrap datepicker pick one day before?

查看:22
本文介绍了为什么angularjs bootstrap datepicker会在前一天选择?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 angularjs bootstrap datepicker 指令当我从模型中设置日期时,它会在所选日期之前选择一天.

I'm using angularjs bootstrap datepicker directive and when I set a date from model it picks a day before the selected date.

<button type="button" class="btn btn-sm btn-default" ng-click="dt = '2014-09-24'">2014-09-24</button>

这是一个关于该问题的plunk.

Here is a plunk with the issue.

有什么解决办法吗?

推荐答案

这是由于 JS 原生处理日期的方式.AngularUI 团队在文档中提到了这一点.

This is due to the way JS handles dates natively. AngularUI team mentions this in the docs.

这是一种解决方案:Angular-UIui-date 中的日期减去一天

这篇关于为什么angularjs bootstrap datepicker会在前一天选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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