DateRange not working??

DateRange not working??

Hi All,
Can anyone look at this code and guide me why this is not working as expected.
<head>
$(function() {
      var currentDate = new Date()
      var minDateValue = '';
      $("#date_from").datepicker();
      $("#date_to").click(function(){
         minDateValue = timeDifference(dateFormat(currentDate, "yyyy-mm-dd"),dateFormat($("#date_from").val(),"yyyy-mm-dd"));
         //alert(minDateValue);
         $("#date_to").datepicker({minDate: -(minDateValue), maxDate: '+11D'});
      });
   });
</head>
<body>
<body>

<div class="demo">
<p>Date From: <input type="text" name="date_from" id="date_from"> Date To: <input type="text" name="date_to" id="date_to"></p>
</body>
</body>

I am passing minDataValue dynamically.. but it's not working as expected with the minDate. minDate always takes the first value only not the dynamic value.

Thanks in Advance