From http://stackoverflow.com/questions/13459866/javascript-change-date-into-format-of-dd-mm-yyyy