Try This:

  $("#datepicker").val("01/06/2009").datepicker({
    changeMonth: true,
    changeYear: true,
    minDate: 0,
    dateFormat: "dd/mm/yy",
    defaultDate: new Date("June 1, 2009") // or new Date(2009,5,1)
  });

Note that your code had a minDate of zero and you post said you were
trying to set the default to 01/01/2009.  That date would be
unreachable since it is prior to the min date.

Hth,

Dave


On Apr 17, 3:22 am, nickdrew <[email protected]> wrote:
> Sorry to bump this, but ideally I need to get it working asap :(
>
> Thanks
>
> On Apr 15, 10:59 pm, nickdrew <[email protected]> wrote:
>
> > Thanks Nathan, any recommendations on the formatting? I set the date
> > as above... dateFormat: 'dd/mm/yy'
>
> > And then entered the input with value="01/01/2009" (for example) and
> > it wouldn't pick it up at all :(
>
> > On Apr 15, 9:42 pm, Nathan Maves <[email protected]> wrote:
>
> > > The only way I have found to do this is just to set the value of the
> > > textfield that the datepicker is attached to.  Then when the user clicks 
> > > on
> > > that field it will open the datepicker to that value.
>
> > > Nathan
>
> > > On Wed, Apr 15, 2009 at 8:39 AM, nickdrew <[email protected]> wrote:
>
> > > > Sorry, should have been more clear, just want to define a date of, for
> > > > example: 31/12/1985
>
> > > > On Apr 15, 2:58 pm, nickdrew <[email protected]> wrote:
> > > > > Hi guys,
>
> > > > > I currently have this code to display and configure a datepicker:
>
> > > > > $("#datepicker").datepicker({changeMonth: true, changeYear: true,
> > > > > minDate: 0, dateFormat: 'dd/mm/yy'});
>
> > > > > It works fine, but for some reason I can't set a default value for the
> > > > > picker... manually defining the value="" in the input displays it, but
> > > > > the picker doesn't recognise it, so that's not really an option
> > > > > unfortunately.
>
> > > > > I've also tried the defaultDate function, but had no joy with that
> > > > > either.
>
> > > > > Any advice please?! I'm at a loss with this to be honest.
>
> > > > > Cheers
--~--~---------~--~----~------------~-------~--~----~
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