Skip to content

Instantly share code, notes, and snippets.

@jayfid
jayfid / index.js
Created June 1, 2025 01:48
ParseTime
const parseTime = (input) => {
if (!input) return 0;
let hours = 0;
for (const piece of input.split(" "))
hours += getTimePieceValue(parseInt(piece.slice(0, -1), 10), piece.charAt(piece.length - 1));
return hours;
};
const getTimePieceValue = (numericValue, timePiece) => {
switch (timePiece) {

Keybase proof

I hereby claim:

  • I am jayfid on github.
  • I am jayfid (https://keybase.io/jayfid) on keybase.
  • I have a public key whose fingerprint is 0DE3 4C3E 3DD2 CD0A B068 6C6B 4063 D9A6 DACF AEF9

To claim this, I am signing this object: