Dojo Parse ISO-8601 Date Strings
Fiddle exploring how to parse a ISO-8601 formatted date string. Specifically, how do you convert string in the format "YYYY-MM-DD" to a date object using the Date utilities packaged with Dojo.
HTML
<div id="container">
<table cellpadding="2" cellspacing="2" border="2" width="100%">
<tr>
<th>input string
<br/>
</th>
<th>parsed date (toUTCString)
<br/>
</th>
</tr>
<tr>
<td>2013-12-02</td>
<td id="content"></td>
</tr>
</table>
<br />
<br />
</div>
JavaScript
require([
'dojo/dom',
'dojo/dom-construct',
'dojo/date/stamp'
], function (dom, domConstruct, stamp) {
var contentNode = dom.byId('content'),
dateObject = stamp.fromISOString('2014-12-20T22:10:00+0100'),
utcDateString = dateObject.toUTCString(),
utcDateHtml = '<i>' + utcDateString + '</i>';
console.log('utcDateString');
console.log(utcDateString);
domConstruct.place(utcDateHtml, contentNode);
});