How to convert date to words in HTML

datetime, html, javascript

Solution

Absolutely with the wonderful MomentJS.

dob = moment(dob).format('DD MMMM YYYY');

Problem

I have a date displayed in HTML. The date is currently displayed as `2012-03-12`. So now, I want to display this date as words i.e it should be displayed as `12 March 2012`. Below is the HTML code I used. ``` <tr> <th>Date of Birth: </th> <td>{{dob}}</td> </tr> ``` Here, `dob` contains the value that has to be converted to words. How can I do this?

Original source

Related problems