Cerrado

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".

Habilidades: Javascript, PHP, jQuery / Prototype, HTML

Ver más: 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

Información del empleador:
( 5 comentarios ) Minnesota, United States

Nº del proyecto: #20348351

28 freelancers están ofertando el promedio de $141 para este trabajo

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 en 5 días
(476 comentarios)
8.6
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 Más

$350 USD en 3 días
(123 comentarios)
8.7
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 Más

$50 USD en 1 día
(1904 comentarios)
8.2
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 Más

$140 USD en 7 días
(98 comentarios)
7.8
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 Más

$90 USD en 7 días
(379 comentarios)
7.5
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 en 4 días
(44 comentarios)
6.4
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 Más

$250 USD en 2 días
(26 comentarios)
6.5
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 Más

$300 USD en 7 días
(74 comentarios)
6.6
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 Más

$80 USD en 7 días
(107 comentarios)
6.7
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 Más

$140 USD en 7 días
(42 comentarios)
6.6
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. Más

$140 USD en 7 días
(56 comentarios)
5.9
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 en 1 día
(96 comentarios)
5.8
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. Más

$120 USD en 2 días
(45 comentarios)
5.3
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 en 3 días
(31 comentarios)
4.9
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 Más

$140 USD en 5 días
(19 comentarios)
4.9
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 Más

$150 USD en 3 días
(40 comentarios)
4.9
shiva1977

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

$30 USD en 1 día
(43 comentarios)
4.8
codeqtechnology0

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 en 3 días
(4 comentarios)
4.0
srivanikannan

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 Más

$120 USD en 1 día
(2 comentarios)
3.5
AMITALLIED

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 Más

$140 USD en 7 días
(9 comentarios)
3.3