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

221
Views
check if a date is between two dates in different years

I'm gonna use MomentJs or Dayjs to see if for instance Apr/03 is between Nov/01 and May/01.

When we try isBetween it doesn't work as in a year Nov/01 is not before Apr/03 but if you look at it as a two-year scop it should return true for moment('Apr/03').isBetween('Nov/01', 'May/01')

P.S. I cannot enter a year, for instance Apr/02/2021 is not an option.

Ok then, exports, what do you recommend?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm going to assume the earlier bound will always be in the first year and the later bound will always be in the second year, otherwise it is pretty much impossible.

moment('Apr/03').isAfter('Nov/01') || moment('Apr/03').isBefore('May/01')

about 4 years ago · Juan Pablo Isaza Report
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!