datepicker日期关闭一天 [英] datepicker date off by one day

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

问题描述

日期选择器返回的日期在一天之前关闭。这是我的代码中的问题还是一个bug?

The date returned by date picker is off by one day. Is it a problem in my code or is it a bug?

发送到date_picker的日期是2012-03-21。 datepicker返回的日期是2012年3月20日。

The date sent to date_picker is 2012-03-21. The date returned by datepicker is Tue Mar 20 2012.

    var end_date = end_calendar.getFormatedDate("%Y-%m-%d");
    end_date = $.datepicker.formatDate('D M dd yy', new Date(end_date));


推荐答案

似乎是一个错误。如果发送到Date()的字符串格式为2012/03/21而不是2012-03-21。日期似乎正确。

Seems to be a bug. If the string sent to Date() is formatted as 2012/03/21 instead of 2012-03-21. The date seems right.

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

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