Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
Creating a chrono-node customer parsing with a relative date

I'm using the https://github.com/wanasit/chrono package and was trying to expand the functionality to include an additional abbreviation. ('m' for minutes)

You'll notice m => minutes does not exist in the mapping array found here: https://github.com/wanasit/chrono/blob/1320d7c403cb4da23a8e06d82fcff5748f552936/src/locales/en/constants.ts#L136

I tried using a custom parser but I'm not quite understanding how it works:

const custom = chrono.casual.clone();
custom.parsers.push({
    pattern: () => {
        return /([\b|0-9]+)(m)\b/i;
    },
    extract: (context, match) => {
        return {
            minute: match[1]
        };
    }
});

If I type "in 15mins" (native parsing) it adds 15 minutes to "now" (relative) If I type "in 5m" using my customer parser, it sets the times minute to 5. (absolute)

How do I make my parser work with times relative to "now"

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!