I got this:
function parseDate(s) { var d = s.split(/\D/); return new Date(d[2], --d[1], d[0]);
with the calendar tag like this:
<p:calendar id="testDate" styleClass="calendar" pattern="d MMM, yyyy" maxlength="10" onchange="$(this).val(parseDate($(this).val()))" onfocus="$(this).mask('99/99/9999');" > <p:watermark for="testDate" value="mm/dd/yyyy" /> </p:calendar>
I need to manually parse a date from 'dd/mm/yyyy' to 'd, MMM yyyy' but with the function above the result is e.g. "Wed, Aug 09 1995 00:00:00" hence could someone help me and tell how how i could change the format so that the string produced would be d, MMM yyyy?
I know this should be a very basic task however i am still learning how to code better, therefore all your help and explanations are greatly appreciated!