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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:02:56+00:00 2026-06-08T19:02:56+00:00

When my sproc returns a null, it goes into a C# DateTime as a

  • 0

When my sproc returns a null, it goes into a C# DateTime as a MinDate. If a date of this form gets to the front end (MVC/Razor), I create a “MinDate” type of my own in JavaScript for comparison. If they match, I want to return an empty string from the JavaScript function. However, although the two dates match, the branch of my “if” statement that returns the empty string is never entered. I’ve looked at these two dates until I’m cross eyed and they appear to match. Why is my function returning the MinDate and not the empty string? (By the way, the “toString()” method is from the DateJS library.)

// Setup a minDate to mimic C#'s Date.MinDate constant.
var minDate = new Date();
minDate.setFullYear(1, 0, 1);
minDate.setHours(0, 0, 0, 0);

function checkDateWithConfig(d, c) {

    alert("Date: " + d);
    alert("minDate: " + minDate);

    if (d == minDate) {
        alert("dates matched");
        return "";
    }
    else
    {
        return d.toString(c);
    }
}

The MinDate from C#:

My JavaScript "MinDate":

  • 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-06-08T19:02:57+00:00Added an answer on June 8, 2026 at 7:02 pm

    Javascript Date objects are references.
    You cannot use == to check whether two Date objects represent the same value.

    Instead, compare the getTime() method on both dates, which returns a number.

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

Sidebar

Related Questions

This SPROC returns a table with two columns: Id, Score. Is it possible to
I've create a SPROC that saves an object and returns the id of the
this statement I use in a sproc (where the search phrase 'reiseportal*' is a
I have a sproc that returns at least 4 columns and then n columns
I have a sproc that returns a single line and column with a text,
In oracle, I want to create a delete sproc that returns an integer based
With this SQL snippet from my SPROC: -- Having the PanelPayout role gives you
LINQToSQL doesn't like my sproc. It says that the sproc has return type none,
The sp_password sproc in sql server 2000 only required membership in the db_accessadmin db_securityadmin
I am trying to look at an execution plan for a sproc that has

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.