// date October 10 2018 pmt 10:01
date = moment(details.date).format("MMMM DD YYYY at h:mm");
How to escape moment reserved keywords like a? I want the output to be October 10 2018 at 10:01
.
// date October 10 2018 pmt 10:01
date = moment(details.date).format("MMMM DD YYYY at h:mm");
How to escape moment reserved keywords like a? I want the output to be October 10 2018 at 10:01
.
You can also achieve it using:
const date = moment(details.date);
const formattedDate = moment(date).format("DD MMM YYYY [at] hh:mm A");
Why not just break it up into two parts?
const date = moment(details.date);
const formattedDate = `${date.format("MMMM DD YYYY")} at ${date.format("h:mm")}`;