Question: how to change date format from dd/mm/yyyy to dd-mmm-yyyy in javascript?
Answer: Use the Moment. js library http://momentjs.com/ It will save you a LOT of trouble. You can use toLocaleDateString and hunt for a format that's close to DD-mmm-YYYY (hint: 'en-GB'; you just need to replace the spaces with '-'). I've made a custom date string format function, you can use that.