Angular 8 convert string to date in typescript angular 8 code example
Example: string to date angular
let dateString = '02/05/2020';
let momentVariable = moment(dateString, 'MM-DD-YYYY');
let stringvalue = momentVariable.format('YYYY-MM-DD');
console.log(stringvalue); // outputs 2020-05-02