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

uiDatepicker from not working in origin/master 2014-04-22 #587

Closed
TheSin- opened this issue Apr 22, 2014 · 9 comments
Closed

uiDatepicker from not working in origin/master 2014-04-22 #587

TheSin- opened this issue Apr 22, 2014 · 9 comments

Comments

@TheSin-
Copy link
Collaborator

TheSin- commented Apr 22, 2014

for some reason when using from it is being set to the to date in the current master branch as of today.

http://jsfiddle.net/r5DUc/3/

@thezoggy
Copy link
Collaborator

side question, dateFormat: 'yy-mm-dd' why does yy show the 4 year version YYYY.. used to seeing Y or YYYY for that.. but anyways i confirm I do see the 'from:' date being incorrectly set (assuming the value pass+format is valid)

@TheSin-
Copy link
Collaborator Author

TheSin- commented Apr 22, 2014

I believe yy will work for both 2 digit and 4, basically I just want year-month-day. Either way it works ;)

I think in js it doesn't have Y, I'm not a js expert though. I know for query I'd always used yy

EDIT: Just tested, Y will put a literal Y, YYYY is also a literal, yyyy will put 20142014, so yy is the 4 digit year in jquery.

@thezoggy
Copy link
Collaborator

im just used to ISO 8601 format..
http://javascript.info/tutorial/datetime-functions#parsing-from-string-date-parse

but yeah its a jui datepicker thing... not stock js thing.. i just never use that widget so not used to it.

@TheSin-
Copy link
Collaborator Author

TheSin- commented Apr 23, 2014

I hear ya I'm used to the php/perl/bash style myself. I just try to stay using everything query makes life easier I feel then mixing. Plus it's a nice little widget and I don't have to write/maintain my own that way ;)

I started trying to track this issue down but so far everything looks right I can't seem to figure out why it's over writing the from stuff, I know they are sharing o (the var(hash) o is being reused though it always has so I doubt it's that).

@Mottie
Copy link
Owner

Mottie commented Apr 23, 2014

Hey guys!

Sorry, I found the problem... the closeDate function is converting the date using new Date() but you aren't using a regular U.S. format, so it's returning an invalid date. Also, I had to add a setTimeout between setting and getting the datepicker date. I'll push out this fix to my working branch in a few minutes.

@TheSin-
Copy link
Collaborator Author

TheSin- commented Apr 23, 2014

sweet thank you I'll test it ASAP, I wonder why the to date works if it's non US then, shouldn't has reset to 1969 if it didn't understand the date? Then I select a date for the from it works, just not on load. Lots of questions there I know I'm just surprised that non-US was an issue here.

@Mottie
Copy link
Owner

Mottie commented Apr 23, 2014

That was only part of the problem, the biggest issue was that the "filterFomatterUpdate" event is being triggered twice. The first time everything worked fine, but the second time the datepicker wasn't catching the change from when a set time and get time were being called, so that's why I added the setTimeout.

@TheSin-
Copy link
Collaborator Author

TheSin- commented Apr 23, 2014

test the current fix it looks good.

http://jsfiddle.net/r5DUc/4/

What branch do you have it in I tried to switch to development and it did not like that, most of my other stuff started to break, I'm still getting used to github ;)

EDIT: NVM found it in the working branch. I'm going to test it with my live code now and see, thanks again.

@TheSin-
Copy link
Collaborator Author

TheSin- commented Apr 23, 2014

okay working perfectly for me!

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

No branches or pull requests

3 participants