For example I have a date input like 2022-04-02T00:00:00 when I use
{{data?.dateStarted | date:'MM/dd/YYYY'}}
the output would be 04/02/2022. But how do we convert to Long Date like April 2, 2022.
Any idea guys ? would really appreciate it , thanks. regards.
CodePudding user response:
I would use Momentjs, it makes date conversion so much easier with clean code. Check this for all possible formats: https://momentjs.com/
npm install --save moment
import * as moment from 'moment';
const formattedDate = moment(this.existingDate).format('MMM Do YY');