extract the start of the line separately

* static/js/index.js: let's not try to match against the prefix more
  than once
also handle JavaScripts native date formats

* static/js/index.js: try to use the browser's parser before parsing
  manually