Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong year when entering a time range #4

Closed
johannahoerrmann opened this issue Nov 6, 2009 · 4 comments
Closed

wrong year when entering a time range #4

johannahoerrmann opened this issue Nov 6, 2009 · 4 comments

Comments

@johannahoerrmann
Copy link

Everything is fine when entering the first date and time (let's say December 14, 2009 / 18:30) but when I use the "end"-slider to define a time (e. g. 21:30) the dates' years are automatically changed (December 14, 2005 / 21:30 to December 14, 2006 / 18:30). I can change the year back to 2009 in the input field though.

@nilshoerrmann
Copy link
Contributor

Note: We should check if this happens in the current release, too, as you are using a newer, unpublished version with localisation support.

@johannahoerrmann
Copy link
Author

Okay. I discovered the following: the problem occurs when choosing a date in december, no other month. It's also not dependant on a time range, but the year is actually set to one year before whenever I change the time. (I start with 2009, choose a time, it's set to 2008, I change the time, it changes to 2007, ...)

@johannahoerrmann
Copy link
Author

I checked the current release and could detect the following: Everything is alright when entering a range in december, but when my start date is in december and I choose one of the grayish dates of January displayed in the december calendar page as the end date, the year for this second date jumps two years ahead (e.g. dec. 19 2009 – jan. 1 2011, dec. 7 2010 – jan. 1 2012).

@nilshoerrmann
Copy link
Contributor

It seems like I misinterpreted the .last().month() function of the dateJS framework. I used the following code:

if(date.is().january()) date.last().year();
date.last().month();

because I thought that .month() will only reset the month number and not the year. But it did reset both correctly. Deleting the first line of the code should solve the problem.

Should be fixed in the next version.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants