From 613dfb9d259166a40d0781e26b8ecd0f59648a25 Mon Sep 17 00:00:00 2001 From: KeeganForelight Date: Thu, 27 Apr 2023 11:14:05 -0400 Subject: [PATCH] updating to reflect current period --- timetracker | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/timetracker b/timetracker index f17974d..fc99be3 100755 --- a/timetracker +++ b/timetracker @@ -25,6 +25,8 @@ ARCHIVE_DIR="$TIMESHEET_DIR/archive" TIMESHEET=$(ls "$TIMESHEET_DIR" | grep ".csv") # generated by clock in CURRENT_SESSION="$TIMESHEET_DIR/.session" +# first day of a pay period to base off of +STARTING_PERIOD="April-14-23" createTimesheet() { @@ -34,8 +36,8 @@ createTimesheet() { mkdir -p "$TIMESHEET_DIR" fi - payperiods=$((($(date +%s) - $(date -d "Dec-30-22" +%s)) / (14*24*3600))) - period_end=$(date -d "Dec-30-22 + $((($payperiods + 1) * 14)) days" +%b-%d-%y) + payperiods=$((($(date +%s) - $(date -d "$STARTING_PERIOD" +%s)) / (14*24*3600))) + period_end=$(date -d "$STARTING_PERIOD + $((($payperiods + 1) * 14)) days" +%b-%d-%y) TIMESHEET=$(printf "%s.csv" "$period_end") # create timesheet echo "Date, Time In, Time Out, Total Time (HH:MM)" > "${TIMESHEET_DIR}/${TIMESHEET}"