75
rated 0 times
[
77]
[
2]
/ answers: 1 / hits: 17861
/ 8 Years ago, tue, august 23, 2016, 12:00:00
The below method sends date to text box in this format Wed Sep 14 2016 00:00:00 GMT+0400
.
So i tried to use substring method to get date in this format Sep 14 2016
i have tried to it in below code but it didn't work
it return this error Uncaught TypeError: date.substring is not a function
<script>
$(document).ready(function () {
var dateval = $('#<%= txtdate.ClientID %>').val();
if (dateval != '') {
var options = {
selectedDate: dateval,
size: 'medium',
width: 960
}
} else {
var options = {
size: 'medium',
width: 960
}
}
$('#paginator').datepaginator(options);
$('#paginator').on('selectedDateChanged', function (event, date) {
$('#<%= txtdate.ClientID %>').val(date.substring(4, 12));
});
});
</script>
More From » jquery