Fix missing overtime print
This commit is contained in:
parent
cd891bf6a0
commit
bb79ecdaa1
3 changed files with 7 additions and 7 deletions
|
@ -1,6 +1,5 @@
|
|||
import chalk from 'chalk';
|
||||
import { Duration } from 'dayjs/plugin/duration';
|
||||
import getConfig from './config';
|
||||
import { parseDuration, parseTimestamp } from './parse';
|
||||
import * as readline from 'readline/promises';
|
||||
import { formatDuration, formatTime } from './format';
|
||||
|
@ -110,10 +109,10 @@ const input = async (config: WtcConfig): Promise<WtcPromptResult> => {
|
|||
const unLogged = worked.subtract(logged);
|
||||
const workLeft = workDayDuration.subtract(worked);
|
||||
let workLeftMinutes = workLeft.asMinutes();
|
||||
let workedOverTime: Duration | undefined;
|
||||
let workedOvertime: Duration | undefined;
|
||||
|
||||
if (workLeftMinutes < 0) {
|
||||
workedOverTime = dayjs.duration(Math.round(workLeftMinutes * -1), 'minutes');
|
||||
workedOvertime = dayjs.duration(Math.round(workLeftMinutes * -1), 'minutes');
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -125,6 +124,7 @@ const input = async (config: WtcConfig): Promise<WtcPromptResult> => {
|
|||
hadLunch,
|
||||
worked,
|
||||
workLeft,
|
||||
workedOvertime,
|
||||
};
|
||||
} finally {
|
||||
rl.close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue