Know when something happened? Get there faster - Papertrail Blog

The revolution will be verbosely {,b}logged

Know when something happened? Get there faster

Posted by Eric Lindvall on

Finding what you are looking for quickly is Papertrail’s primary goal. We found that too often the dates we typed into the time/date selector weren’t parsed correctly and found that some users didn’t even know they could quickly jump to a specific date and time.

Something had to be done about this. So we’ve made the date/time selector impossibe to miss with a clear icon near the search box. We also revamped the time parsing, so it now provides instant feedback in the browser. You know you’ll be sent to the right place when you hit enter.

Here’s what it looks like:

New Date/Time Finder

Highlights of the new date/time finder

  • It gives immediate feedback when you type
  • It’s easier to find
  • It tries really hard to interpret dates as in the past (even Papertrail doesn’t support predictive logging)
  • It does a good job parsing timezones
  • It’s a good platform for further improvements

Here are some cool dates and times that it parses:

  • 12th at 8pm
  • april 9th at 4:45pm
  • yesterday at 2am GMT
  • Aug 07 09:00:07 EST
  • Wed Aug 24 12:46:48

If you find dates or times that you think it should parse but it doesn’t, please let us know! We will be continuing to improve the parser as we run into cases that don’t parse the way they should.

How does the new parser work?

We use the very cool date.js date and time parser to try to figure out the time as you type. It lets Papertrail give instant feedback about whether and how it parses what you typed.

It also now parses a lot of the formats that users expected to work (we logged any unsuccessfully parsed times and have verified that they work now). It also properly parses timezones, so you can specify “8pm EST” and it knows what you mean. Handy when pasting a timestamp and timezone from an email.

Improvements to date.js

date.js would sometimes assume that relative dates and times like “friday at 8pm” were dates in the future, when Papertrail users are always referring to the past. Also, some dates were parsed properly by chronic but didn’t work in date.js.

We forked date.js and implemented these changes. A pull request has been submitted but the maintainer hasn’t responded yet. Papertrail’s fork will be maintained until or unless it’s merged (including any additional bug fixes).