I am rendering through EJS template like this and table data coming from Database
<td><%= Patient.StudyDate %></td>
Patient.StudyDate is a string and rendering as 20181029 (first 4 is a year then 2 is a month and last 2 is a day so I want to change this string to dd-mm-yyyy) and it's coming from Database
I want to show that like this 29-10-2018
How to do that in EJS templating language?

Use regexp to match days, month and year and put it in correct order