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

  • SEARCH
  • Home
  • 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 3663936
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:35:14+00:00 2026-05-19T01:35:14+00:00

I will try to be as specific as possible. I’ve completely confused myself with

  • 0

I will try to be as specific as possible. I’ve completely confused myself with everything I’ve tried, so hopefully someone will be able to help me out.

I have a list of images that all have certain start and end dates for which they should be displayed on the page. Before I continue, I am looking for a strictly Javascript/jQuery solution; a server-side solution, however possible, is not what I’m asking for.

I use a js example I found somewhere else to find the current date with the following:

var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var yearInt = parseInt(year);
var currentDate = month + "/" + day + "/" + year;

I then use ajax and $.each to go through all of my xml nodes and return all values, including a start date and end date for each image.

What type of conditional should I write so that the images display if they hold the following info:

Current Date: 05/20/2010

Image1:
Start Date: 01/30/2010 – End Date: 06/15/2010

Image2:
Start Date: 05/20/2010 – End Date: 06/20/2010

Image2:
Start Date: 06/12/2010 – End Date: 06/20/2011

And of course hide if they’re past the end date?

Any help would be greatly appreciated! I’ll answer any questions as quickly as possible. Thanks!

  • 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-19T01:35:14+00:00Added an answer on May 19, 2026 at 1:35 am

    I would recommend casting your dates as Date() objects, you can then do a comparison on them.

    var currentDate = new Date(year, month, day);
    var startDate = new Date(insert start date);
    var endDate = new Date(insert end date);
    
    if(currentDate >= startDate && currentDate < endDate) {
        //show images
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have iOS4 specific code (ie the MKMapView overlays) in an
I wanted to add to my jdk6\jre\lib\security\java.policy file an interdiction to create some classes
Ok, Last time I posted this (last week), I didn't describe the problem correctly.
Free of charge, simple to learn/use, Cross Platform C library for GUI Apps? Am
i am using excel 2007... i have the following ranges... D E G H
I know this is not a straight up question, so if you need me
I am very new at all this c# Windows Phone programming, so this is
I currently have a user control that is used on both an /Address/Edit and
I have a need for methods in several classes that must always follow a
The hashCode value of a Java String is computed as ( String.hashCode() ): s[0]*31^(n-1)

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.