Jump to content

jQuery get clock input to minutes and get between and display in input

Joveice
Go to solution Solved by leonfagan71,
2 hours ago, Joveice said:

Hello, So I want to get the time between two times and display the total minutes in an input. How can I do this? I'm not a javascript guy.

This is not what I intend to use, but from there I know I can get it to work as I want it to.


<div class="form-group">
                                <label class="sr-only" for="displayTime">Tid</label>
                                <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                                    <div class="input-group-addon"><i class="far fa-clock"></i></div>
                                    <input class="form-control" id="displayTime" disabled> <!-- display here -->
                                </div>
                            </div>
                            <div class="row">
                                <div class="col">
                                    <label class="sr-only" for="timeStart">Tid</label>
                                    <div class="input-group" id="clockStart" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <i class="far fa-sign-in"></i>
                                        </span>
                                        <input class="form-control" id="timeStart" value="08:00"> <!-- start time -->
                                    </div>
                                </div>
                                <div class="col">
                                    <label class="sr-only" for="timeEnd">Tid</label>
                                    <div class="input-group" id="clockEnd" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <i class="far fa-sign-out"></i>
                                        </span>
                                        <input class="form-control" id="timeEnd" value="15:30"> <!-- end time -->
                                    </div>
                                </div>
                            </div>

 

https://jsfiddle.net/ghbzg1gL/

Hello, So I want to get the time between two times and display the total minutes in an input. How can I do this? I'm not a javascript guy.

This is not what I intend to use, but from there I know I can get it to work as I want it to.

<div class="form-group">
                                <label class="sr-only" for="displayTime">Tid</label>
                                <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                                    <div class="input-group-addon"><i class="far fa-clock"></i></div>
                                    <input class="form-control" id="displayTime" disabled> <!-- display here -->
                                </div>
                            </div>
                            <div class="row">
                                <div class="col">
                                    <label class="sr-only" for="timeStart">Tid</label>
                                    <div class="input-group" id="clockStart" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <i class="far fa-sign-in"></i>
                                        </span>
                                        <input class="form-control" id="timeStart" value="08:00"> <!-- start time -->
                                    </div>
                                </div>
                                <div class="col">
                                    <label class="sr-only" for="timeEnd">Tid</label>
                                    <div class="input-group" id="clockEnd" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <i class="far fa-sign-out"></i>
                                        </span>
                                        <input class="form-control" id="timeEnd" value="15:30"> <!-- end time -->
                                    </div>
                                </div>
                            </div>

 

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Joveice said:

Hello, So I want to get the time between two times and display the total minutes in an input. How can I do this? I'm not a javascript guy.

This is not what I intend to use, but from there I know I can get it to work as I want it to.


<div class="form-group">
                                <label class="sr-only" for="displayTime">Tid</label>
                                <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                                    <div class="input-group-addon"><i class="far fa-clock"></i></div>
                                    <input class="form-control" id="displayTime" disabled> <!-- display here -->
                                </div>
                            </div>
                            <div class="row">
                                <div class="col">
                                    <label class="sr-only" for="timeStart">Tid</label>
                                    <div class="input-group" id="clockStart" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <i class="far fa-sign-in"></i>
                                        </span>
                                        <input class="form-control" id="timeStart" value="08:00"> <!-- start time -->
                                    </div>
                                </div>
                                <div class="col">
                                    <label class="sr-only" for="timeEnd">Tid</label>
                                    <div class="input-group" id="clockEnd" data-autoclose="true">
                                        <span class="input-group-addon">
                                            <i class="far fa-sign-out"></i>
                                        </span>
                                        <input class="form-control" id="timeEnd" value="15:30"> <!-- end time -->
                                    </div>
                                </div>
                            </div>

 

https://jsfiddle.net/ghbzg1gL/

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×