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

104
Views
Data filter with calendar dates range

I'm using PickMeUp calendar to filter the events list based on user date pick.

Here is the fiddle: https://jsfiddle.net/Lkpmczte/1/

I have no idea what I'm doing wrong. Here's an excerpt:

let startDay;
let endDay;
let result;

pickmeup(element);
element.addEventListener("pickmeup-change", function(e) {
  startDay = e.detail.formatted_date[0];
  endDay = e.detail.formatted_date[1];

  result = data.filter(function(obj) {
    return obj.date >= startDay && obj.date <= endDay;
  });
  getDay();
});

let getDay = () => {
  return startDay === endDay ?
    console.log(startDay) :
    console.log(`${startDay} - ${endDay}`);
};

btn.addEventListener("click", () => {
  console.log(result);
});

But it turns back an empty array...

I would appreciate any kind of help :) Thanks in advance!

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

0

Solved. I had a typo in date format. I used dashes when I should've used slashes.

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!