Skip to content

androsanta/work-hours-to-sheet

Repository files navigation

Work sheet[s]

What & Why

At the company where I'm currently employed there's the necessity to fill a Google Sheet with the number of hours worked in the particular day.
This imply the following steps:

  • Open the Google Sheet link from the saved bookmark on the browser
  • Wait for it to load extremely slowly ... at least on my pc
  • Fill in the required informations: date, surname, job performed and hours worked

The purpose of this small project is to speed up this process by filling all the required informations from the command line.

Usage

To install the package globally, clone the repo and run this command inside the project folder:
$ npm i -g .

The script uses the Google Sheet API to save partial time information in Sheet 1 (e.g. 9.00-13.00):

Set start time to 9.30
$ worksheet start -t 9.30

Set stop time to current time
$ worksheet stop

Once there's at least a time interval in Sheet 1 it's possible to save the total amount of time worked into Sheet 2 (the official sheet that needs to be compiled) with the command:
$ worksheet end-day

This command compute the total amount of time worked approximating to the quarter, by defect or excess if the quarter is passed by more o less than 7 minutes and 30 seconds.
For example 7h 50m becomes 7h 45m, while 7h 55m becomes 8h


Telegram Bot

The project contains also a telegram bot from which it's possible to execute the same commands of the CLI. It also checks periodically if the total time is close to 8 hours to send a notification with a random inspirational quote.
It has been fun to program the bot but I've never actually used it 🤓

About

Set work hours to Google Sheet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages