Hi all:
I found this great function:
Now I have an array which holds dates that are selected, it is in javascript.
The issue is I have to format each value in the array to regular date...
I have been trying this:
The alert box keeps bringing up undefined???
Can someone tell me what m I doing wrong????
PS this.selectedDates is my array of what the user have selected off the calendar. It brings the dates up this way
Thu Mar 29 00:00:00 EDT 2007,Fri Mar 30 00:00:00 EDT 2007
Thanks
Zishan
I found this great function:
Code:
<script type="text/javascript">
Date.prototype.toJSDate = function() {return ((this.getMonth() + 1 < 10) ? "0" + (this.getMonth() + 1) : (this.getMonth() + 1)) + "/" + ((this.getDate() < 10) ? "0" + this.getDate() : this.getDate()) + "/" + String(this.getFullYear()).substr(2, 2) ;};
function convertDate(obj) {
var dte = new Date(obj.value);
obj.value = dte.toJSDate();
}
</script>
Now I have an array which holds dates that are selected, it is in javascript.
The issue is I have to format each value in the array to regular date...
I have been trying this:
Code:
z_cal.prototype.submitSelections = function (returnToDefaultMonth)
//PRIVATE: submit the calendar's selection variables
{
alert(convertDate(this.selectedDates));
};
Can someone tell me what m I doing wrong????
PS this.selectedDates is my array of what the user have selected off the calendar. It brings the dates up this way
Thu Mar 29 00:00:00 EDT 2007,Fri Mar 30 00:00:00 EDT 2007
Thanks
Zishan