Added dateAsValue() function to format date for proper html5 input value

According to html5 specs the date input type value has to be formatted using http://tools.ietf.org/html/rfc3339 spec. I added this helper to do exactly that. Before this code was failing in chrome.