Javascript Date Calculator v2

Simple javascript solution to calculate 45 and 180 days from that input date and display the two dates (month, day, year) and some various text boxes associated with the two outputs.

As soon as the 4 number year is input the output will be generated.

I have included a screen shot and the javascript file. As you can see there is an error with the javascript. The result is correct. Date arithmetic that crosses month boundaries is off by 1 because there's no day 0 in months.

For example, if you input the date of October 1, 2019, you will get the results of:

45 days: Thursday, November 14, 2019

180 days: Sunday, March 29, 2020

But, if you input the date of December 1, 2019, you will get the results of:

45 days: Wednesday, January 15, 2020

180 days: Friday, May 29, 2020

This can not be correct because there are 31 days in December. 31 + 15 = 46? Some sort of miscalculation happens in most months.

The reason you're getting November 14 in the first case is because daylight savings time changes sometime in October. Your afterTime() function treats all days as 24 hours long, but when DST ends we add an extra hour to that day. So you're going from Oct 1 00:00:00 to Nov 14 23:00:00 instead of Nov 15 00:00:00.

Use the built-in date arithmetic in the Date class, it automatically adjusts for this.

This pen here pulls the correct date but it is from the current date and not the actual input dates

[login to view URL]

Can you fix? I will only consider people who start their quote with the word "BLUE".

Skills: JavaScript, PHP, jQuery / Prototype, HTML

See more: javascript difference between two dates in days, calculate difference between two dates in months using javascript, javascript difference between two dates in minutes, javascript difference between two dates in years months days, javascript date difference in days hours minutes seconds, javascript subtract dates, javascript date difference in months, javascript date difference in years, calculator deposit simple interest earned daily, javascript mortgage calculator design, example javascript date calculations acrobat, javascript mortgage calculator, javascript mortgage calculator code, javascript date picker query, simple time management excel, web simple time input javascript, javascript simple time sheet, javascript simple time form, simple javascript money calculator, simple date calculator script

About the Employer:
( 5 reviews ) Minnesota, United States

Project ID: #20348351

28 freelancers are bidding on average $141 for this job


BLUE Hi, I understood your issue and I need to fix it(As per brief) We are ready to get started right away... Best Regards, LX

$300 USD in 5 days
(476 Reviews)

Hello! We are a team of 30+ web developers based in Russia. Our team is interested in developing your project. Having the required skills, we will be glad to help you. We have some questions regarding your projec More

$350 USD in 3 days
(123 Reviews)

BLUE Hello, My name is Sergey. I am Freelancer from Saint Petersburg, Russia. I can help you as an experienced programmer to update your JavaScript and calculate +45 and +180 days properly. 2000+ successfully More

$50 USD in 1 day
(1904 Reviews)

HI, I can assist you with Javascript Date Calculator. Here is a sampling of the few of my work contained at my portfolio: This is a placehoolder bid, I would be able to quo More

$140 USD in 7 days
(98 Reviews)

Hi BLUE, I have checked the codepen and when I placed December 1, 2019, result is correct: [login to view URL] Could you send me the screenshot of the current script you got? I can't see it here on the descriptio More

$90 USD in 7 days
(379 Reviews)

blue i can fix it easy and fast as i know the code issue i am a top js expert with 15 years experience Regards

$200 USD in 4 days
(44 Reviews)

Hi How are you? I read your proposal and i am quite interested in your project I have rich experience in javascript, jquery, I will delivery perfect result on time. I look forward to working with you in good partnersh More

$250 USD in 2 days
(26 Reviews)

BLUE Hi!! I can surely fix this. I am JavaScript Developer having more then 5 years experience in javascript development. Skills: JavaScript, PHP, WordPress, HTML5/CSS3/Bootstrap3, Jquery, MySql I would like to arr More

$300 USD in 7 days
(74 Reviews)

Hello I have read your description carefully and I'm sure I can complete it in time perfectly. I've rich experience in Web development over 5+ years. I've good knowledge of js frameworks such as Angular, React.js, and More

$80 USD in 7 days
(107 Reviews)

100% Completion Rate and 5 Stars Hi, there. My name is Lee, and I am an experienced web developer. I read your job description, and I am interested in your project. I have 6+ years of experiences in developing websit More

$140 USD in 7 days
(42 Reviews)

Hi,client I have been working for 8 years working in freelancer. In these times , I have a lot of experiences in Javascript , HTML5, PHP ,Node.js and Angular.js ,Laravel, CI ,React.js ,ASP.NET, C#, MongoDB, Express.js. More

$140 USD in 7 days
(56 Reviews)

hi i have 4 years experience in like thins kind of job, hi i have 4 years experience in like thins kind of job, hi i have 4 years experience in like thins kind of job

$80 USD in 1 day
(96 Reviews)

BLUE Hi, Thanks for sharing your requirement here at Freelancer, I will be more than happy to help you. First of all the screenshot and javascript code is missing that you mentioned attached with your requirement. More

$120 USD in 2 days
(45 Reviews)

Blue Hi Do leaps years need to be considered as well? It can get messy - I would probably use some sort of library for this. Please let me know if interested.

$50 USD in 3 days
(31 Reviews)

Hello, I am a full stack developer!! i just checked your description correctly. Very interesting and motivated project.... I have 10+ years experience web development and web design. let us discuss more details and More

$140 USD in 5 days
(19 Reviews)

Hi, I have read through your job descriptions, and I understand all of the requirements. I am applying because I believe that I have the required skill set to complete your project. I have been working as a PHP develo More

$150 USD in 3 days
(40 Reviews)

BLUE. I have 10+ years of experience in Javascript. I understand your requirement and I can deliver it in time.

$30 USD in 1 day
(43 Reviews)

Dear Sir I am very interested to work on your project. I can deliver on time according to your requirement. Regards Arpit Singh

$45 USD in 3 days
(4 Reviews)

BLUE Js expert, I have around 12+yrs of experience in web application development I have almost worked on 50+ web applications sites including front end and backend frameworks. I have worked on plenty of date manipu More

$120 USD in 1 day
(2 Reviews)

Dear Sir, You have recently advertised for javascript developer . After reading the job description I am confident that I would be a perfect fit for this position as my experience and abilities precisely match your req More

$140 USD in 7 days
(9 Reviews)