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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:14:40+00:00 2026-05-29T19:14:40+00:00

I have a table to which i dynamically add rows. The number of days

  • 0

I have a table to which i dynamically add rows. The number of days is equal to the date difference of the dates inserted by user. On the dynamic rows i want to add three fields. The first two are date and day filed. For that I need to know the next date and the corresponding day. For example user enters 10-2-2012. I need to insert The next dates like 17-2-2012,18-2-2012… and corresponding days like Wednesday, Thursday..etc
I have used the following function to get next date

function getTomorrow(d,offset)
{
    if (!offset)
    {
       offset = 1
    }
    return new Date(new Date().setDate(d.getDate() + offset));
}

But it shows error 16-2-2012 has no getDate() function. Am not able to find next date and the corresponding day. Is there any way to get it?

  • 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-29T19:14:44+00:00Added an answer on May 29, 2026 at 7:14 pm

    You have to convert the string d into a Date object:

    function getTomorrow(d,offset){
        if (!offset){
            offset = 1;
        }
        if(typeof(d) === "string"){
            var t = d.split("-"); /* splits dd-mm-year */
            d = new Date(t[2],t[1] - 1, t[0]);
        //  d = new Date(t[2],t[1] - 1, t[0] + 2000); /* for dd-mm-yy */
        }
        return new Date(d.setDate(d.getDate() + offset));
    }    
    
    document.write(getTomorrow('16-02-2012',20) + ' test');
    
    var k = getTomorrow('16-02-2012',1);
    var myTime = k.getDate()+'-'+(k.getMonth()+1)+'-'+k.getFullYear();
    
    alert(myTime);
    

    JSFiddle Demo. See also http://www.w3schools.com/jsref/jsref_obj_date.asp.

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

Sidebar

Related Questions

I have a table in which i add rows dynamically and i want to
I have a table with about 5,000 rows which I build dynamically with jQyuery.
I have a table which has a button to Add Rows. This button adds
I have a table in which I am adding some rows dynamically and in
I have been researching the JQuery way to add table rows dynamically. One excellent
I have a jsp page in which rows of a table are added dynamically.
I have a table which is being dynamically populated, each row contains two textfields
I have a table which is being dynamically populated from MySQL. The table has
i have a table which contains a bunch of dynamically created radio button lists,
I have a dynamically created table which in the last <td> there is 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.