GithubHelp home page GithubHelp logo

horas's Introduction

Horas

Just another daily hours calculator.

About

Horas is a simple script developed in Node.js to calculate your daily hours. It supports various time ranges - including lunchtime. The labor and lunch hours are configurable.

Installation

To use Horas you'll need to have Node.js installed on your system. Download it or follow alternative steps for installing it, as brew install node on Mac.

You can check if your system has Node.js installed by typing node -v on your terminal and pressing Enter/Return.

If you have Node.js correctly installed, follow these steps:

  • Clone this repository (git clone https://github.com/hildersantos/horas)
  • cd horas && npm install
  • Optional yet recommended step for macOS: ln -s /absolute/path/to/horas/horas /usr/local/bin

Doing this last step, Horas should be accessible through the horas command.

After that you're good to go.

Usage

The examples below consider that horas is available in your $PATH.

You can check the exact time you need to clock out by using horas [ARRIVE_TIME] [LUNCH_START] [LUNCH_END]. It considers an 8 hour work day.

If for any reason you need to adjust your working day time, you can do that by using the -t option, passing along an hour number.

Example:

$ horas -t 6 09:00 12:00 13:00
You have worked for 3h00m. Clock out at 16:00.

It's possible to know the clock out time even without passing a lunch time.

$ horas 09:00
Clock out at 18:00 (considering an hour of break time).

You can even adjust the lunch time with the -l option:

$ horas -l 0.5 09:00
Clock out at 17:30 (considering 30 minutes of break time).

To know how much hours you worked in a day, pass one or more time ranges.

$ horas 09:00 12:00 13:00 17:00 17:30 18:30
You have worked for 8h00m.

If you have any improvement suggestions, fell free to reach me out or fork this project and open a PR.

Future improvements

  • Validate time range
  • Calculate day-based ranges (e.g. horas 21:00 00:00 01:00)

horas's People

Contributors

hildersantos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.