Answer the question
In order to leave comments, you need to log in
How to check if an array element is a date?
Good afternoon, a dynamic array is returned from the backend, containing different data (*example of one line):
-101 2019-03-01T00:00:00 2019-03-01T00:00:00 начисление Х --- ---
@Pipe({
name: 'armDate'
})
export class ArmDatePipe implements PipeTransform {
transform(date): any {
const regexp = "(\\d{4}-\\d{2}-\\d{2})[A-Z]+(\\d{2}:\\d{2}:\\d{2})";
if(date !== undefined || date !== null){
date.replace(regexp);
return date;
}
return date;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question