Some code style tweaks

This commit is contained in:
Marko Korhonen 2023-11-11 18:19:10 +02:00
parent 8ac794ac7b
commit 50144cfc99
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890

View file

@ -7,7 +7,7 @@ import { parseDuration, parseTimestamp } from './parse.js';
const { log, error } = console;
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 main = async () => {
@ -75,8 +75,7 @@ const main = async () => {
let worked = dayjs.duration(stopped.diff(started));
const lunchAnswer = await rl.question('Did you have a lunch break? [Y/n] ');
if (lunchAnswer.toLowerCase() !== 'n') {
if ((await rl.question('Did you have a lunch break? [Y/n] ')).toLowerCase() !== 'n') {
worked = worked.subtract(lunchBreakDuration);
}