All files / src/app/components/timetrack/day-view day-view.component.ts

90.9% Statements 10/11
20% Branches 1/5
100% Functions 1/1
90% Lines 9/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 362x 2x 2x 2x       2x                         2x             1x     2x   2x      
import { CommonModule } from "@angular/common";
import { Component, EventEmitter, Input, Output } from "@angular/core";
import { FormsModule } from "@angular/forms";
import { TranslateModule } from "@ngx-translate/core";
import { DateI } from "../date";
import { UserInfo } from "../user-info/user-info";
import { WorkTime } from "../work-time/work-time";
import { WorkTimeComponent } from "../work-time/work-time.component";
 
@Component({
    selector: "app-day-view",
    standalone: true,
    imports: [
        CommonModule,
        FormsModule,
        WorkTimeComponent,
        TranslateModule,
    ],
    templateUrl: "./day-view.component.html",
})
export class DayViewComponent {
    @Input() date?: DateI;
 
    @Input() userInfo!: UserInfo; 
 
    @Input() workTime?: WorkTime;
 
    @Output() readonly saved = new EventEmitter<WorkTime>();
 
    parseDate (date?: DateI) {
        Iif(date && date.year && date.month && date.day)
            return new Date(date.year, date.month - 1, date.day);
        return undefined;  
    }
}