Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6874315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:10:45+00:00 2026-05-27T04:10:45+00:00

We got a website that makes a json request to the server. The server

  • 0

We got a website that makes a json request to the server. The server returns these kind of items:

var items = new Array();
items[] = {
    id: 1
    date: '2011-12-01',
    time: '03:00:00'
    endDate: '2011-12-04',
    endTime: '05:00:00'
}

Now what I got is a date filter on the client side, so you can pick a filter and then it will only return the items matching that date. But here is the problem:

Lets say the users picks a date for example: “2011-12-02”, it will ONLY look at the “date” element in the array, however if the endDate is not null (because it is not required, then the item will last one day) it has to match between those periods, so 2011-12-02 would still return the item since the begin date was 2011-12-01 and the end date was 2011-12-04 so it is between those 2 dates, so I would still have to get the item.

How do I solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:10:46+00:00Added an answer on May 27, 2026 at 4:10 am

    You actually have to parse those dates and check the range.

    For example,

    var myDate = new Date(2008, 9, 16);
    // is myDate between Sept 1 and Sept 30?
    var startDate = new Date(2008, 9, 1);
    var endDate = new Date(2008, 9, 30);
    if (startDate < myDate && myDate < endDate) {
        alert('yes');
        // myDate is between startDate and endDate
    }
    

    taken from other question

    hope this helps your further…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a an old website that I've taken over. New users essentially get
I've got a website that I've just uploaded onto the interwebs, and it's displaying
I've got a website that has windows authentication enable on it. From a page
I've got a website that has a form that the user can type in.
Hopefully a nice simple one. I've got a php3 website that I want to
I've got a website project under version control that relies on files from an
I've got this ASP.NET 2.0 website project in Visual Studio that I've been working
I am trying to put 2 columns into a website, I've got that to
I have two websites that post news information. I just got a request to
I work for a company that makes application's in C#. recently we got a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.