admin管理员组文章数量:1316974
I have used full calender in my project. DefaultView is weekview.
In week view when click in between 5pm to 6pm(Date:21-11-2015) timeslot, it gives perfect time slot timing with 21-11-2015 5:00pm to 6:00pm.But when i click on 7pm to 8pm(Date:21-11-2015) timeslot it gives me wrong time with 22-11-2015 7:00pm to 8:00pm.
I don't know how date change to next day. Actual date must be 21-11-2015 7:00pm to 8:00pm.
My timezone is Asia/Kolkata (GMT+05:30).
I have used full calender in my project. DefaultView is weekview.
In week view when click in between 5pm to 6pm(Date:21-11-2015) timeslot, it gives perfect time slot timing with 21-11-2015 5:00pm to 6:00pm.But when i click on 7pm to 8pm(Date:21-11-2015) timeslot it gives me wrong time with 22-11-2015 7:00pm to 8:00pm.
I don't know how date change to next day. Actual date must be 21-11-2015 7:00pm to 8:00pm.
My timezone is Asia/Kolkata (GMT+05:30).
Share Improve this question edited Nov 18, 2015 at 6:47 Dhara asked Nov 18, 2015 at 6:11 DharaDhara 1,4815 gold badges30 silver badges48 bronze badges 1- 1 some code or JSfiddle may be... – Minato Commented Nov 18, 2015 at 6:39
1 Answer
Reset to default 8Finally i got solution.
dayClick: function(date, allDay, jsEvent, view)
{
alert(date); // Gives Sat Nov 21 2015 19:00:00 GMT+0000
}
Here date gives me Sat Nov 21 2015 19:00:00 GMT+0000. And my timezone is Asia/kolkata (GMT+05:30). so it automatically add 05:30 hours to 19:00:00. So date is converted to next day.
For this problem i do following process.
dayClick: function(date, allDay, jsEvent, view)
{
var tzDifference = date.getTimezoneOffset() //this gives me timezone difference of local and UTC time in minutes
var offsetTime = new Date(date.getTime() + tzDifference * 60 * 1000); //this will calculate time in point of view local time and set date
}
And i get date which i want.
本文标签: javascriptFull calendar On click of time slot wrong time selectedStack Overflow
版权声明:本文标题:javascript - Full calendar: On click of time slot wrong time selected - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742020918a2414656.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论