Fix #52 check if date is valid when moment.js is available

Also adds an example to showcase the use with moment.js