import { Component , Input } from '@angular/core' ; import { UntilDestroy } from '@ngneat/until-destroy' ; import { DateFormatPipe } from '../../pipes' ; @ UntilDestroy ( { checkProperties : true } ) @ Component ( { selector : 'ngx-date-range-title' , template : `{{ title }}` } ) export class DateRangeTitleComponent { _start : Date ; get start ( ) : Date { return this . _start ; } @ Input ( ) set start ( start ) { this . _start = start ; } _end : Date ; get end ( ) : Date { return this . _end ; } @ Input ( ) set end ( end ) { this . _end = end ; } constructor ( private readonly dateFormatPipe ) { } /**
     * GET date range title
     */ get title ( ) { const start = this . dateFormatPipe . transform ( this . start ) ; const end = this . dateFormatPipe . transform ( this . end ) ; return [ start , end ] . filter ( Boolean ) . join ( ' - ' ) ; } }