Hi,
It looks like you are converting the Date object to a string by adding a
space to the start of it. Instead you should use the methods available
on the Date object itself. So something like this should work:
$('.holdDate').html(selectedDate.asString());
(the asString method is defined in date.js and will format your date
according to the Date.format you have set).
Alternatively you can use the native methods of the date object:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Date
Hope that helps,
Kelvin :)
pedalpete wrote:
I've made some progress with this, but my code is looking really
strange.
To rehash, I am trying to get the datepicker to update a span, not an
input.
But i was getting an error.
Now I can update the span, but I can't split the date variable before
I update (it gives blank time and gmt details that I don't need
anyway).
For some reason I have to have a space before the selectedDate
variable, or it isn't recognized and i get an error.
Anybody know why this is?
Here's my working code...
[code]
$('.dateItem')
.datePicker({inline:true})
.bind(
'dateSelected',
function(e, selectedDate, $td)
{
var getDate = ' '+selectedDate;
var splitDate = getDate.split("00:00:00");
$('.holdDate').html(splitDate[0]);
}
);
[/code]