File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export default class TimeCard {
154154 await self . getTimeCardData ( ) ;
155155
156156 let output = self . prettyPrintHeader ( ) ;
157- self . timecardData . shifts . map ( item => {
157+ self . timecardData . shifts . forEach ( item => {
158158 output += self . prettyPrintEntry ( item ) ;
159159 } ) ;
160160 output += self . messages . prettyPrintBorder ;
Original file line number Diff line number Diff line change @@ -66,8 +66,13 @@ export function clockoutSummary(shiftSeconds, totalSeconds) {
6666 */
6767
6868export function prettyPrintEntry ( timeobj ) {
69- var time = makeTimeString ( pendel ( timeobj . startTime , timeobj . endTime ) ) ;
70- return ` ${ chalk . white ( timeobj . date ) } ${ chalk . cyan ( to24 ( timeobj . startTime ) ) } - ${ chalk . cyan ( to24 ( timeobj . endTime ) ) } ${ chalk . gray ( '[' ) } ${ time } ${ chalk . gray ( ']' ) } \n` ;
69+ var time ;
70+
71+ if ( timeobj . startTime && timeobj . endTime ) {
72+ time = makeTimeString ( pendel ( timeobj . startTime , timeobj . endTime ) ) ;
73+ return ` ${ chalk . white ( timeobj . date ) } ${ chalk . cyan ( to24 ( timeobj . startTime ) ) } - ${ chalk . cyan ( to24 ( timeobj . endTime ) ) } ${ chalk . gray ( '[' ) } ${ time } ${ chalk . gray ( ']' ) } \n` ;
74+ }
75+ return ` ${ chalk . white ( timeobj . date ) } ${ chalk . cyan ( to24 ( timeobj . startTime ) ) } - ${ chalk . gray ( '[clockout pending]' ) } \n` ;
7176}
7277
7378/**
You can’t perform that action at this time.
0 commit comments