Giter Site home page Giter Site logo

hourlypay.js's Introduction

hourlyPay.js

A simple node.js script for hourly paid workers that calculates how much you already earned today.

Usage

node hourlyPay.js HH:MM mm

  • HH:MM describes the time (HH = Hours, MM = Minutes) when you checked in at your workplace.
  • mm describes how many minutes of break you did today (lunch, etc...)
  • default checkin time is 09:00 and default break time is 30 minutes -> these will be used when no arguments are passed

Examples (with a hourly rate of 13€)

  • With no passed arguments (default for checkin is 09:00 and default for break time is 30 minutes)
$ node hourlyPay.js 

Checkin time : 09:00 --> 9
Current time : 17:01 --> 17.02
Hours worked : 8.02 Hours
Lunchbreak   : 0.50 Hours (30 Minutes)
Work - Lunch : 7.52 Hours
Earned money : 97.76€ (7.52 x 13)

  • With checkin time 13:37 and 5 minutes of break time
$ node hourlyPay.js 13:37 5

Checkin time : 13:37 --> 13.62
Current time : 17:03 --> 17.05
Hours worked : 3.43 Hours
Lunchbreak   : 0.08 Hours (5 Minutes)
Work - Lunch : 3.35 Hours
Earned money : 43.55€ (3.35 x 13)

Customization

The hourly rate can be adapted in the code: just set var moneyPerHour = XX; to whatever you earn in an hour.
The currency can also be adapted, change var currency = "€";
The defaults for checkin time and break time can also be changed, change var passedCheckInTiny = "09:00"; and var lunchBreak = 30; respectively.

##How to get global access to the script

  • Clone the repository
  • Create a symlink:
    • From hourlyPay.js in the cloned repo
    • To your local bin environment thingy thing (On Mac OS: /usr/local/bin)
    • Example: ln -s ~/Repositories/hourlyPay.js/hourlyPay.js /usr/local/bin/hourlyPay
  • You now can access it everywhere by typing hourlyPay HH:MM

hourlypay.js's People

Contributors

verfehlix avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.