import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
    name: 'checkfield'
})
export class CheckfieldPipe implements PipeTransform {

    transform(arr: any): unknown {
        const ArraySeat = arr.testing_seat_subjects;
        if (!ArraySeat) return    false;
        let isField = false;
        if (ArraySeat){
            for (let i = 0; i < ArraySeat.length; i++ ){
                if (ArraySeat[i].start_seat_no == null && ArraySeat[i].end_seat_no != null ){
                    isField = true;
                }
                if (ArraySeat[i].start_seat_no != null && ArraySeat[i].end_seat_no == null ){
                    isField = true;
                }
            }
        }
        return isField;
    }

}
