I'm getting really frustrated with the datePicker.

I'm trying to create a booking form with "Date From" and "Date To",
the two date fields are given an initial value which sets the "Date
From" field to be 2, 3 or 4 days in the future, and the "Date To"
field is set at the date of the last available date for booking. If a
"Date From" is picked, then the user should not be able to pick a
"Date To" before this date, and vice versa.

Lots of these datePicker scripts allow the developer to do this simply
using a few settings. But for me to do it with datePicker I have to
mess around with initial minDate and maxDate settings, then modify
those settings for the other datePicker control if a date is selected
on the other. Fine, I think I can do this using onchange/onblur events
or whatever useful features jQuery has.

But why oh why are the minDate and maxDate settings so difficult to
set? They require a date to in the following format, the default
format generated by "new Date(2009, 7 - 1, 9)":
Tue Jun 09 2009 17:01:06 GMT+0100 (GMT)
// (what is wrong with the month value that means it needs the -1 to
generate the intended month? why does month start at 0 when day starts
at 1?!)

Or you can put the dates in some strange custom syntax which allows
you to specify a date by adding or subtracting days/weeks/months/
years.

Wouldn't it just be simpler to use the date format specified in
dateFormat? Or at least in a format that allows the value of one date
field to be useful to another date field. Well I suppose the reason
for that is because the dateFormat setting isn't very accurate either.
Why does dd/mm/yyyy equate to 09/06/20092009? Yet dd/mm/yy equates to
09/06/2009. Surely it should be 09/06/2009 and 09/06/09 respectively.
Or it could follow the same formatting as the php/etc date functions.

Which genius thought of that? God almighty talk about making life
difficult for anyone who dares to use it! Are there plans to improve
the datePicker? Because at the moment I am stumped to work out how the
hell I am going to get it to do one of the most basic requirements of
a datePicker.

Basically I need to work out how to convert "09/06/2009" to "2009, 7 -
1, 9", so I can convert it to "Tue Jun 09 2009 17:01:06 GMT+0100
(GMT)", so I can pass it to minDate or maxDate. But I'm not hopeful
because I can't even get this to work.

<input type="hidden" id="jsDateFrom" name="jsDateFrom" value="2009,
7-1, 9" />

$(document).ready
(
        function()
        {
                var jsDateFrom = $('#jsDateFrom').val();
                alert(jsDateFrom);

                var datetest = new Date(jsDateFrom);
                alert(datetest);
        }
);

Looks like I am going to have to give up with this one unless someone
can point me in the right direction...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to