Parse a natural duration into seconds in JavaScript
I wrote this for a little Chrome extension I maintain and thought it might be useful to someone else. It parses a natural language duration like “1h30m” or “37 days, 1 hr, 3 mins and 7s” into a straight number of seconds.