Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8413947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:02:24+00:00 2026-06-10T01:02:24+00:00

Demo Here in jsbin demo i m getting start time but i dnt know

  • 0

Demo Here in jsbin demo i m getting start time but i dnt know any idea how to get end time.
how should i go further to get end time.
i dont want to change html.
i have to get end time using present html.
i m trying since last three days.

$("#btnAllot").click(function ()
            { var calculateStartMins = $('td.csstd:first');var calculateStartHrs = calculateStartMins.parent().prevAll().andSelf().find('td:first-child').filter(function(){return $.trim($(this).text()) !== '';}).last();
                    var fromTime = calculateStartHrs.text().trim() + calculateStartMins.text().trim();
                    var fromTimeAMPM = fromTime.substring(5, 7);
                    var fromTimeHour = fromTime.trim().substring(0, 2);
                    var fromTimeMinute = fromTime.substring(7, 10);
                    var hidFromTime = fromTimeHour.trim() +":"+ fromTimeMinute.trim();alert("Start Time is "+hidFromTime.trim()); 
             var endTime = $('td.csstd:last').parent().next().andSelf().find('td:first-child').
                filter(function ()
                {return $.trim($(this).text()) !== '';
               }).last();alert("End Time is "+endTime);
            });   
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:02:26+00:00Added an answer on June 10, 2026 at 1:02 am

    You’re thinking way too complicated, I guess… See if this works for you:

    $("#btnAllot").click(function(){
        var begin = $("td.csstd:first"), end = $("td.csstd:last"),
            beginHour, endHour, endMinute, currentHour, beginTime, endTime;
        $("tr.csstablelisttd").each(function(){
            var minuteTd = $(this).find("td").eq(1),
                t = $(this).find("td:first").text().trim();
            (t.length) && (currentHour = t);
            (minuteTd.filter(begin).length > 0) && (beginHour = currentHour);
            (minuteTd.filter(end).length > 0)   && (endHour   = currentHour);
        });
    
        endHour = endHour.replace(/00/, "").split(":");
        endHour[0] = Number(endHour[0]);
        endMinute = (Number(end.text().trim())+15) % 60;
        if (endMinute == 0) {
            endHour[0] = (endHour[0] + 1) % 12;
            if (endHour[0] == 0) {
                endHour[0] = 12;
                endHour[1] = endHour[1] == "AM" ? "PM" : "AM";
            }
        }
        (endHour[0] < 10) && (endHour[0] = "0"+endHour[0]);
        (endMinute < 10) && (endMinute = "0"+endMinute);
    
        beginTime = beginHour.replace(/00/, begin.text().trim()); 
        endTime   = endHour[0] + ":" + endMinute + endHour[1];
    
        alert("Start time is "+beginTime);
        alert("End time is "+endTime);
    });
    

    DEMO (JSFiddle)

    JSBin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://jsbin.com/emoba5/3/edit click here to view demo Does anybody know how to make the image
Here I have a demo of Jquery slideToggle core working on an element, but
There is a three.js demo here: http://mrdoob.github.com/three.js/examples/webgl_loader_collada.html It works perfectly, but if I want
Consider the following example which should color every second row: ( live demo here
I have set up a demo here: http://jsbin.com/evifeb/ This is more of me thinking
I don't get it. I can't increment the Tweet-ID ... Here is a demo:
Here is a link to my code: http://jsbin.com/ebadic/9/edit It is from a demo I
Please see demo here: http://jsfiddle.net/mA6qm/1/ (expand console) Why aren't events being sent or received
Please see the demo here: http://jsfiddle.net/Freewind/Vkp4U/ The html: <div class=outer> <div class=x>x</div> <div class=y>y</div>
Consider the following example: ( live demo here ) HTML: <div class=board> <div class=row>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.