I'm using jQuery and want to format a date. I don't want to have to import another plug-in for jQuery. I have found a solution that works in JavaScript i.e.
var now = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
$('##optionButtons').append('<a href="##"class="btn">'
+ curr_date + "-" + curr_month + "-"
+ curr_year + '</a> </ br>');
However, when I add the date shown in the example below I get the following error, why?
var d = value.CREATED;
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
$('##optionButtons').append('<a href="##">'
+ curr_date + "-" + curr_month + "-"
+ curr_year + '</a> </ br>');
ERROR ##################### d.getDate is not a function ###########################
The value of 'value.CREATED' is October, 25 2012 00:00:00+0000