• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Help needed in javascript coding

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I am again here with a big task in my project which I am unable to do.

I am having 3 text fields and 3 list boxes;

Two text fields will contain values of two different dates (which I am getting using the datetimepicker.js library file) one for start date and another for end date.

Two list boxes which have time duration of 24hours with an interval of 5 minutes each as its options.. One list box for start time and another for end time.

3rd list box which has its options as: minutes, hours, days, months and years.

I have 3rd text field, "time allotted" which takes a numeric value as its input.

Now the problem is when I select dates from the first two text fields: start date and end date, I have to calculate the difference of the dates and display the difference in the "time allotted" text box and make "days" selected from the list box. Similarly if I select same date from the first two text fields and select time from the list boxes: start time and end time, I need to calculate difference of the both the times and display the difference in the "time allotted" text box and make "minutes" selected. And same is the case with months and years. Can anyone help me how to achieve this task.

I wrote a loop to generate values in the start time and end time list boxes:

 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HINT:
var Date1 = new Date(datefiled + timeFiled);

Eric
 
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic