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 6938017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:26:16+00:00 2026-05-27T12:26:16+00:00

tl;dr; How would you take StartDate-DateTime: Dec 10th 2011, EndDate-DateTime Jan 15th 2012, and

  • 0

tl;dr;
How would you take StartDate-DateTime: Dec 10th 2011, EndDate-DateTime Jan 15th 2012, and determine whether or not Dec 1, Dec 9,Dec 17,Dec 25, Jan 1, and Jan 9 fit into that TimeSpan, Year excluded and get a Bool for each one?

I have a visual timespan consisting of a linear graph showing when a specific activity is active.

enter image description here

I am given an object with a start date, and an end date.

I have covered the timespan with a DIV having a red background representing 1/4 of each month, naming them JanQ1, JanQ2, etc..

These start off as visibility:hidden, but need to be altered in the event that the activity is active during the part of the year.

The problem I’m having is getting a true/false value that ignores the year being given.

For example, an event that goes from Dec 10th 2011 to Jan 15th 2012, I would want this result set:

DecQ1=False,
DecQ2=True,
DecQ3=True,
DecQ4=True,
JanQ1=True,
JanQ2=True,
JanQ3=False
  • 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-27T12:26:17+00:00Added an answer on May 27, 2026 at 12:26 pm

    Would a function like this work for you?

    bool IsDateContained(DateTime startDate, DateTime endDate, int month, int day) {
        bool retVal = false;
        if (startDate < endDate) {
            do {
                if (startDate.Month == month && startDate.Day == day) {
                    retVal = true;
                    break;
                }
                startDate = startDate.AddDays(1);
            } while (startDate < endDate);
        } else {
            //crazy world!!
        }
        return retVal;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It would take too long to explain why I need this, but I was
I would really appreciate if you would take a look at this piece of
What is the average time that it would take a complete novice, whose background
Are there any Code Generators that would take a well-formed XML document, and write
I wanted to write a function that would take an object and convert it
I am wondering what other approaches you would take to do some simple string
Is there any plugin for jQuery that would take an argument for the max
I'm trying to create a custom JSP tag that would take an array object
I'm looking for a Python module that would take an arbitrary block of text,
I was looking for some utility class/code that would take a java bean and

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.