• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic