permalinks
permalinks copied to clipboard
Use Moment to test date validity
Rather than test the val against a Date type, using Moment's own isValid() - as it's to determine whether to pass to Moment or not seems sensible and is more forgiving of different formats found in FrontMatter
Thanks for the PR.
Could you resolve the conflicts or create a new PR based off master?
npm test
produces:
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.