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

@Pipe({
  name: 'dateToISO',
  standalone: false
})
export class DateToISOPipe implements PipeTransform {

  transform(value: string | null | undefined, ...args: unknown[]): string {
    /**
     * Converts any string format to angular standard
     * @param {String} input
     * @returns {String}
     */
    let input = '';
    if (typeof value === 'string' && value !== "") {
      input = new Date((value as string)).toISOString();
    }
    return input;
    
  }

}
