I have a cell which displays Date in the format MM/DD/YYYY, I use DatePipe and display using below
code:
datepipe.transform(new Date(), ‘MM/dd/yyyy’);
It displays the current date, say 06/10/2020
But when I send this value to backend , I actually want to save along with time, i.e; hh:mm:ss
I was trying to see if there is a pattern that we can set, while defining the columns which actually displays date only , but actual value is date and time
Hi,
Yes I actually used type ‘date’, it was a typo here.
Here is the implementation:
afterSetDataAtCell(event) {
this.tableInstance.setDataAtCell(e[0], 2, this.mydatePipe.transform(new Date(), ‘MM/dd/yyyy hh:mm:ss a’))
}