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
setDateTime sets DatePicker date to default date as of jQueryUI 1.8.14 #5
Comments
I'm looking into this and seems a little more complicated. I haven't checked your solution because that would only work for the default date format, for other formats that contain no breaking spaces will not work. As for the object part that should not fail as that is used when the date is a javascript date object instead of a date string. I'm trying to determine if it could be a bug in jquery ui datepicker as the problem does not happen with dates in formats like DayofWeek, DayofMonth Month Year. I was thinking of a problem in parseDate function but if I run code like:
it is parsed correctly to the correct date no matter the appended time. So I haven't found the source of this yet. I found a problem too that will be corrected with this. The syntax:
is not working to set the date. And as it is now only works calling datepicker directly, with syntax like:
Still working on it. Thanks for the report, |
I'm wrong about the parseDate. I was testing the wrong version, 1.8.10. But in the newer version you report yes the parseDate triggers an error: "Extra/unparsed characters found in date: xx:xx" and no matter the date format. I continue looking into this. |
In the report I left, the setDateTime I passed in was "2011/06/29 On 11-07-04 4:49 AM, manfer wrote:
|
I think I have solved this. I wanted to try a more general approach valid for any date format. This issue has made me realize I was not taking that approach in the function that sets time from a datetime string. What I'm doing in my solution is, with the help of the configured time format for the picker, I divide the datetime string into a date string and a time string (just searching for the time with a builded regular expression). I'm going to recheck and test it, and I will push it as soon as possible. Regards, |
No hurry on my part, what I have is working for me or I can roll back to On 11-07-04 7:49 AM, manfer wrote:
|
Found a related problem with IE 8
If I set the date and time in Firefox, Safari or IE 9 it works, IE 8 in error sets the time sliders to all 0 no matter what time is set. If I follow the setDateTime call with a setTime call then IE 8 works properly as follows: If I try to split the setDateTime into a setDate followed by a setTime with the appropriate pieces of the date time string then the setDate does not work in any browser. My date format seems to work in setDateTime but not in setDate. Ron |
I thought I had pushed the changes that correct this issue but hadn't. I had tested my changes working with jQuery 1.6.2 and jQuery UI 1.8.14 Now I had pushed it after confirming that it works with latest versions, jQuery 1.6.4 and jQuery UI 1.8.16. Released v0.5 of dateplustimepicker. I hope that solves the issue. In my tests it seems no problem now to set the datetime together with any date and time formats. Hope you can confirm it too. Thanks. Regards. |
I thought maybe you had got very busy and I had a workaround until this IE8 problem popped up. I have verified it works for all browsers I am using and so will close the issue. Many thanks |
jQueryUI 1.8.14 fixed a bug in date setting which causes the setDate option to accept only the date portion of a date time string.
In the 1.4 (latest) release line 1121 I changed the line
to be
For more context here is the listing of the entire block
I suspect there might be a problem with the typeof date == 'object' branch 3 lines above as well but I have not seen it, it may be filtered in the DatePicker code.
The patch made it work for me but I may not have taken the completely correct approach such as using space as the date and time separator.
Thanks,
Ron McOuat
The text was updated successfully, but these errors were encountered: