Closed

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

38 freelancers are bidding on average $137 for this job

A2Design

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
(120 Reviews)
8.6
Lxtech

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
(470 Reviews)
8.6
TakeReal

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
(1850 Reviews)
8.1
extreamcode

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

$140 USD in 7 days
(97 Reviews)
7.7
BaNgan

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
(317 Reviews)
7.3
lovestar110

BLUE Dear client. I have read your Codepen code. I can do your project as you want. Would you please give me a chance?

$100 USD in 1 day
(18 Reviews)
6.0
gongfei

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
(23 Reviews)
6.1
seefattechnologi

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
(68 Reviews)
6.4
alexwmsoft

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
(39 Reviews)
6.4
Lionanaimal

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
(42 Reviews)
6.2
okzhang321

Dear, I have many experiences for 10 years in web development using PHP, Laravel, CI Web Framework, YII, WordPress, Joomla, HTML5, CSS3, JS(JQuery, Node.js,Angular.js, React.js, [login to view URL], Vue.js), MySQL, SQL, etc. ht More

$50 USD in 1 day
(65 Reviews)
5.7
valor312

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
(74 Reviews)
6.1
Dmitry610

Hello Dear, Greetings for the day! ⭐⭐⭐⭐⭐ I CAN START IMMEDIATELY ⭐⭐⭐⭐⭐ My name is Dmitry Kraitor and I am individual full-stack&full-time web developer. I have gone through the project description and I am very int More

$200 USD in 7 days
(22 Reviews)
5.7
webcodeater

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
(82 Reviews)
5.6
kapil1308

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)
5.3
vladzolotukhin

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
(12 Reviews)
4.8
makelegend17

BLUE: Hi, sir. How are you? I am an excellent Javascript programmer, so I can complete your project very fast. I already have similar experience in my past work. Please discuss with me and start project right now. Than More

$150 USD in 2 days
(2 Reviews)
4.6
scrufDev

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
(18 Reviews)
4.5
aswebsmart

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
(34 Reviews)
4.6
star314

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
(15 Reviews)
4.7