3

I am displaying a date which takes the following format;

Sun Feb 24 2013 00:00:00 GMT-0800 (Pacific Standard Time)

All what i want is Sunday February 24 2013. How could i format the above date to the format i want ?

var date = $(this).datepicker('getDate');
                  theDay = new Date(date.getFullYear(), date.getMonth(), date.getDate());
user1315906
  • 3,374
  • 8
  • 30
  • 43

1 Answers1

2

Using the DatePicker

$(this).datepicker({
    dateFormat: "DD MM d yy"
});

Example here: http://jsfiddle.net/eJseP/


Edited, by request:

<input type="text" id="myinputfield" value="" />
<script>
    $("#myinputfield").datepicker({
        dateFormat: "DD MM d yy"
    });
<script>
Garis M Suero
  • 7,974
  • 7
  • 45
  • 68