Skip to content
Alex Davydenko edited this page Jun 6, 2019 · 2 revisions

Welcome to the time-calculate wiki!

This project started as a web app. Then I realized I'm too lazy to code click handlers and validate input values. Maybe one day... :)

Interactive usage

$ git clone https://github.com/3rdp/time-calculate
$ cd time-calculate

Launch the Node REPL. Load the module.

$ node
> .load time-calculator.js

Adding time together

Create a variable. Save the new instance of Time Calculator into it:

const calc = new TimeCalculator({}) // notice the empty object

Check how much hours we have added up now:

calc.hours

You'll see 0. Let's add up time you worked on a project during a week. Enter this:

calc.add({ hours: 5, minutes: 20 })

And you'll get this: > {hours: 5, minutes: 20} - Time Calculator has its values updated and it returns them to you. Go on, add the rest of the week.

Note: You can Arrow Up ↑ to navigate through the history of your entered command.

Clone this wiki locally