datepicker with dynamic restriction-dates from smarty

datepicker with dynamic restriction-dates from smarty

Hi all,

i am using smarty and jquery and have got a little problem with the jquery datepicker with restricted date range.
min- and max-date are coming via smarty, and i can't figure out how to pass those to the Date-Object.

Here is what i've tried so far:

var projectEndDate = "{$projectEndDate|date_format:'%B %d, %Y 00:00:00'}";
alert(projectEndDate);  // shows exactly what i need, e.g. "December 23, 2010 00:00:00"

// Following won't work, no max-date is submitted:
$( "#datepicker" ).datepicker({ minDate:new Date(2010, 9, 23), maxDate: new Date(projectEndDate) });

// Following won't work either, no max-date submitted:
$( "#datepicker" ).datepicker({ minDate:new Date(2010, 9, 23), maxDate: new Date({$projectEndDate|date_format:'%B %d, %Y 00:00:00'}) });

// Following will work, but i don't need the max-date hard-coded:
$( "#datepicker" ).datepicker({ minDate:new Date(2010, 9, 23), maxDate: new Date("December 23, 2010 00:00:00") });

Anyone got any ideas for me?  :)