Some code style tweaks
This commit is contained in:
parent
8ac794ac7b
commit
50144cfc99
1 changed files with 2 additions and 3 deletions
|
@ -7,7 +7,7 @@ import { parseDuration, parseTimestamp } from './parse.js';
|
||||||
|
|
||||||
const { log, error } = console;
|
const { log, error } = console;
|
||||||
const defaultStartTime = '08:00';
|
const defaultStartTime = '08:00';
|
||||||
const lunchBreakDuration = dayjs.duration(30, 'minutes');
|
const lunchBreakDuration = dayjs.duration({ minutes: 30 });
|
||||||
const defaultWorkDayDuration = dayjs.duration({ hours: 7, minutes: 30 });
|
const defaultWorkDayDuration = dayjs.duration({ hours: 7, minutes: 30 });
|
||||||
|
|
||||||
const main = async () => {
|
const main = async () => {
|
||||||
|
@ -75,8 +75,7 @@ const main = async () => {
|
||||||
|
|
||||||
let worked = dayjs.duration(stopped.diff(started));
|
let worked = dayjs.duration(stopped.diff(started));
|
||||||
|
|
||||||
const lunchAnswer = await rl.question('Did you have a lunch break? [Y/n] ');
|
if ((await rl.question('Did you have a lunch break? [Y/n] ')).toLowerCase() !== 'n') {
|
||||||
if (lunchAnswer.toLowerCase() !== 'n') {
|
|
||||||
worked = worked.subtract(lunchBreakDuration);
|
worked = worked.subtract(lunchBreakDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue