views:

408

answers:

2

Hello,

At this time, I'm doing this :

var dateSelected = $("#datepicker").datepicker("getDate");
alert(dateSelected.getDate());
alert(dateSelected.getMonth());
alert(dateSelected.getFullYear());

dateSelected value look this : Fri Sep 11 2009 00:00:00 GMT+0200 (Romance Daylight Time)

2 Options :

a) Is it possible to use this in .NET directly (string to DateTime) ?

b) I tried several way to return dd/mm/yyyy without success

Regards,

+3  A: 

You can set the output format for the Datepicker to something more usable in .NET.

Try looking in the docs of jQuery: http://docs.jquery.com/UI/Datepicker/formatDate

Not sure if this is usable in your case, but take a look at it.

Wim Haanstra
+1  A: 

you can set different options of your datepicker

.datepicker({
        duration: 0,
        rangeSelect: true,
        numberOfMonths: 2,
        showWeeks: true,
        closeAtTop: false,
        mandatory: true,
        showOtherMonths: true,
        showStatus: true,
        dateFormat: 'dd/mm/y'
      });

dateformat is one of those options that you need to set

Kennethvr
dateFormat doesn't change the value returned by getDate
Kris-I