diff --git a/timesheets/.session b/timesheets/.session deleted file mode 100644 index 9fe0a87..0000000 --- a/timesheets/.session +++ /dev/null @@ -1,2 +0,0 @@ -DATE=1673627871 -TIME_IN=1673627871 diff --git a/timesheets/Jan-13-23.csv b/timesheets/Jan-13-23.csv deleted file mode 100644 index 817837e..0000000 --- a/timesheets/Jan-13-23.csv +++ /dev/null @@ -1,13 +0,0 @@ -Date, Time In, Time Out, Total Time (HH:MM) -Fri Jan-06, 02:30pm, 05:10pm, 02:40 -Mon Jan-09, 01:35pm, 08:59pm, 07:24 -Mon Jan-09, 08:59pm, 08:59pm, 00:00 -Tue Jan-10, 10:36am, 08:17pm, 09:41 -Tue Jan-10, 08:17pm, 08:20pm, 00:02 -Wed Jan-11, 11:30am, 08:39pm, 09:09 -Thu Jan-12, 10:35am, 10:57am, 00:21 -Thu Jan-12, 10:57am, 11:08am, 00:11 -Thu Jan-12, 11:09am, 11:27am, 00:18 -Thu Jan-12, 11:27am, 11:50am, 00:22 -Thu Jan-12, 11:51am, 07:47pm, 07:56 -Thu Jan-12, 07:47pm, 07:47pm, 00:00 diff --git a/timesheets/archive/timesheet.log b/timesheets/archive/timesheet.log deleted file mode 100644 index 7ee7dfd..0000000 --- a/timesheets/archive/timesheet.log +++ /dev/null @@ -1,105 +0,0 @@ -I 10-03T16:24 -O 10-03T16:25 -I 10-03T16:25 -O 10-03T16:27 -I 10-03T16:27 -O 10-03T16:30 -I 10-03T16:31 -O 10-03T16:31 -I 10-05T09:52 -O 10-05T10:06 -I 10-05T10:06 -O 10-05T10:06 -I 10-05T10:15 -O 10-05T12:53 -I 10-05T17:18 -O 10-05T18:48 -I 10-06T13:21 -O 10-06T13:40 -I 10-07T11:37 -O 10-07T12:59 -I 10-07T16:13 -O 10-07T16:38 -I 10-07T17:06 -O 10-07T20:20 -I 10-08T14:22 -O 10-08T18:50 -I 10-09T14:35 -O 10-09T19:13 -I 10-10T10:35 -O 10-10T16:43 -I 10-11T11:28 -O 10-11T12:29 -I 10-11T14:54 -O 10-11T18:56 -I 10-12T09:45 -O 10-12T12:23 -I 10-12T15:39 -O 10-12T17:06 -I 10-13T09:55 -O 10-13T10:30 -I 10-14T15:25 -O 10-14T17:19 -I 10-16T13:19 -O 10-16T17:00 -I 10-17T10:15 -O 10-17T13:41 -I 10-18T13:22 -O 10-18T13:54 -I 10-18T14:11 -O 10-18T18:00 -I 10-19T10:22 -O 10-19T13:00 -I 10-19T13:25 -O 10-19T16:59 -I 10-19T17:23 -O 10-19T18:34 -I 10-21T12:04 -O 10-21T12:51 -I 10-23T14:59 -O 10-23T17:19 -I 10-24T13:07 -O 10-24T13:57 -I 10-25T15:34 -O 10-25T17:53 -I 10-26T11:57 -O 10-26T19:47 -I 10-27T17:56 -O 10-27T20:23 -I 11-01T13:40 -O 11-01T18:13 -I 11-02T13:24 -O 11-02T18:57 -I 11-03T12:59 -O 11-03T15:53 -I 11-03T17:07 -O 11-03T18:31 -I 11-04T19:07 -O 11-04T19:34 -I 11-07T15:15 -O 11-07T17:11 -I 11-08T13:58 -O 11-08T17:27 -I 11-09T17:02 -O 11-09T19:05 -I 11-10T13:19 -O 11-10T21:12 -I 11-11T16:03 -O 11-11T20:24 -I 11-14T13:39 -O 11-14T14:20 -I 11-14T14:23 -O 11-14T14:23 -I 11-15T17:06 -O 11-15T21:11 -I 11-16T15:11 -O 11-16T17:09 -I 11-17T14:34 -O 11-17T22:01 -I 11-18T15:25 -O 11-18T19:39 -I 11-20T15:34 -O 11-20T19:22 -I 11-21T15:10 -O 11-21T19:09 -I 11-28T12:20 diff --git a/timetracker b/timetracker index fd67d95..ae3f539 100755 --- a/timetracker +++ b/timetracker @@ -18,11 +18,13 @@ EOF } # dir for timesheets -TIMESHEET_DIR="$HOME/.dotfiles/bin/timetracker/timesheets" +WORKING_DIR="$HOME/.local/share/timetracker" +TIMESHEET_DIR="$WORKING_DIR/timesheets" +ARCHIVE_DIR="$TIMESHEET_DIR/archive" # existing -TIMESHEET=$(ls "$HOME/.dotfiles/bin/timetracker/timesheets" | grep ".csv") +TIMESHEET=$(ls "$TIMESHEET_DIR" | grep ".csv") # generated by clock in -CURRENT_SESSION="${TIMESHEET_DIR}/.session" +CURRENT_SESSION="$TIMESHEET_DIR/.session" createTimesheet() { payperiods=$((($(date +%s) - $(date -d "Dec-30-22" +%s)) / (14*24*3600))) @@ -42,7 +44,7 @@ getTimesheet() { period_end=$(date -d "$(echo "$TIMESHEET" | awk -F . '{print $1}') + 1 days" +%s) if [[ $(date +%s) -ge $period_end ]] ; then # past timesheet, moving to archive and creating new - mv ${TIMESHEET_DIR}/${TIMESHEET} ${TIMESHEET_DIR}/archive + mv "${TIMESHEET_DIR}/${TIMESHEET}" "$ARCHIVE_DIR" createTimesheet fi fi