paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fb03d00fa7cec14cb331ba7041a79c447799f7ac
parent a67d80aa3a690ca4138ea7514256369aaf78b3c0
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Thu, 27 Aug 2020 13:44:54 -0400

Start time duration calculator project

Diffstat:
Apages/projects/time-duration-calculator.md | 37+++++++++++++++++++++++++++++++++++++
Apublic/js/time-duration-calculator.js | 26++++++++++++++++++++++++++
Astyle/tdc.css | 8++++++++
3 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/pages/projects/time-duration-calculator.md b/pages/projects/time-duration-calculator.md @@ -0,0 +1,37 @@ +## Time Duration Calculator + +[//]: # "Use this tool to quickly calculate the duration between times." + +[//]: # "main.min.css tdc.min.css" + +[//]: # + +<script type="text/javascript" src=/js/time-duration-calculator.js></script> +<noscript>It seems that the current browser you are using does not support +JavaScript or it has been disabled. JavaScript is required for this applet to +function.</noscript> + +Use this tool to quickly calculate the duration between times. Times are all in +the 24 hour clock (i.e. no AM/PM). + +<div id="grid-container"> + <label for="start-time-h">Hour</label> + <input id="start-time-h" placeholder="0-24" autofocus> + <label for="start-time-h">Minute</label> + <input id="start-time-m" placeholder="0-60"> + <label for="start-time-h">Second</label> + <input id="start-time-s" placeholder="0-60"> to + <br/> + <label for="end-time-h">Hour</label> + <input id="end-time-h" placeholder="0-60"> + <label for="end-time-h">Minute</label> + <input id="end-time-m" placeholder="0-60"> + <label for="end-time-h">Second</label> + <input id="end-time-s" placeholder="0-60"> + <br/> + <button id="calc-btn" onClick="calculate()">Calculate</button> + <p id="result-field">00:00:00</p> + <p id="result-field-hours">0 hours</p> + <p id="result-field-minutes">0 minutes</p> + <p id="result-field-seconds">0 seconds</p> +</div> diff --git a/public/js/time-duration-calculator.js b/public/js/time-duration-calculator.js @@ -0,0 +1,26 @@ +/* +* time-duration-calculator.js +* +* Copyright (C) 2020 Jake Bauer <jbauer@paritybit.ca> +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +function get_inputs() { + document.getElementById +} + +function calculate() { + get_inputs() +} diff --git a/style/tdc.css b/style/tdc.css @@ -0,0 +1,8 @@ +input { + max-width: 3em; + margin-bottom: 0.5em; +} + +button { + margin-top: 0.5em; +}