SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Please Help!!!!

  1. #1
    SitePoint Addict Bloodfest's Avatar
    Join Date
    Feb 2006
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Please Help!!!!

    I'm not very good with Javascript so I'm completely lost... Could someone hook me up with a snippet of code that will show the difference between 2 times, also I need to subtract additional hours from another input field.

    Example:

    StartTime - 09:00 , EndTime - 18:00, Break - 1 hr, Total - 8 hrs

    The red is the calculated field..

    I would greatly appreciate a basic snippet... not something to fancy.. No format checks..

    Thank You

  2. #2
    SitePoint Addict
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This info should help you create the script.

    Create a new Date object for your start_time, end_time, break_time.
    Set the time for each date object.
    Use the get method to subtract as necessary.

  3. #3
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can find more resources to get help here. Have fun!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •