Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

select range not giving correct time span #518

Closed
sandeshfromindia opened this issue Jan 8, 2017 · 4 comments
Closed

select range not giving correct time span #518

sandeshfromindia opened this issue Jan 8, 2017 · 4 comments

Comments

@sandeshfromindia
Copy link

with reference to https://mattlewis92.github.io/angular-bootstrap-calendar/#?example=select-range
after selecting time range by dragging result shows incorrect time range.
if their is any patch for this please let me know
thanks

@mattlewis92
Copy link
Owner

Sorry but I couldn't reproduce your problem, please could you explain a bit more about what the issue is you're experiencing?

@sandeshfromindia
Copy link
Author

hey Matt,
i was just trying your Select range code on plnkr.co, when i select time range 12 AM to 1 AM of 9 jan 2017 it shows that 'You selected on this day: from "2017-01-08T18:30:00.000Z" to "2017-01-08T19:30:00.000Z" ' in alert-info div as you have shown in Demo https://mattlewis92.github.io/angular-bootstrap-calendar/#?example=select-range
i am using bower version of angular-bootstrap-calendar in my practice project,
But when i downloaded your repo and installed all the dependencies and run the code on npm and tried the same thing and it shows ' You selected on this day: from Sun Jan 01 2017 00:00:00 GMT+0530 to Sun Jan 01 2017 01:00:00 GMT+0530 ' which is correct.
i uploaded some pic for your reference which shows the time range problem.
date select
range select

@mattlewis92
Copy link
Owner

Ah, it's because moment objects were being passed instead of date objects and angular wasn't formatting the date to account for the timezone difference i.e. it was rendering the dates in UTC rather than your local timezone. Will cut a new release in a sec with a fix. Thanks for reporting! 😄

@sandeshfromindia
Copy link
Author

ya, that's what i thought of first, cool.. great work Matt, happy to help, Thanks 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants