Is there a way to automatically populate new forms with the current datetime value?
this.editForm.patchValue({
id: chatRoom.id,
creationDate: chatRoom.creationDate != null ? chatRoom.creationDate.format(DATE_TIME_FORMAT) : null,
roomName: chatRoom.roomName,
roomDescription: chatRoom.roomDescription,
privateRoom: chatRoom.privateRoom,
chatUserId: chatRoom.chatUserId
});
In the past, I used
this.creationDate = moment().format(DATE_TIME_FORMAT);
this.chatRoom.creationDate = moment(this.creationDate);
If you have any insights on how to achieve this, please share!
Many thanks for your assistance