alert(end); //Wed Oct 22 2014 00:00:00 GMT+0200 (CEST)
How to display this in format dd.mm.yyyy ?
alert(end); //Wed Oct 22 2014 00:00:00 GMT+0200 (CEST)
How to display this in format dd.mm.yyyy ?
Use built-in methods on the Date object
alert(end.getDate() + "." + (end.getMonth() + 1) + "." + end.getFullYear());
Note: I'm adding 1 to the month, because javascript returns the month in the range 0-11, with January being 0, February 1, etc.
Additional Note: I put parenthesis around that addition, because otherwise it would just do another string concatenation, so July 6, 2013 would become 6-61-2013 without the parenthesis
If you don't mind the additional dependency, you could use Moment.js http://momentjs.com.