import { Pipe, PipeTransform } from '@angular/core';
import * as moment from 'moment';
import { MomentHelper } from '../../common/helpers/moment.helper';

@Pipe({ name: 'stsDateTime' })
export class STSDateTimePipe implements PipeTransform {
  transform(value: string): string {

    const datetime = MomentHelper.DateValidation(value)
      ? moment(new Date(value)).format("DD/MM/YYYY hh:mm:ss")
      : null;

    return datetime;
  }
}
