From 00c2ee5ca223c7862649c6336873a57b6dad943a Mon Sep 17 00:00:00 2001 From: Jack Perala Date: Sun, 5 Apr 2020 23:28:37 -0500 Subject: [PATCH] Re-write timestamp field to use date related call #2 Re-wrote the timestamp field to use a call on a date object to grab the date and time. --- client/src/app/notes/add-note.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/app/notes/add-note.component.ts b/client/src/app/notes/add-note.component.ts index d345d9f..034dc50 100644 --- a/client/src/app/notes/add-note.component.ts +++ b/client/src/app/notes/add-note.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ModuleWithComponentFactories } from '@angular/core'; import { Note } from './note'; import { NoteService } from './note.service'; import { MatSnackBar } from '@angular/material/snack-bar'; @@ -63,13 +63,14 @@ export class AddNoteComponent implements OnInit { const currentDate = new Date(); const newDate = new Date(currentDate.setHours(currentDate.getHours() + 5)); + const timeStampDate = new Date(); const newNote: Note = { owner_id: this.id, _id: undefined, message: formResults.message, expiration: newDate.toISOString(), - timestamp: this.timestamp, + timestamp: timeStampDate.toLocaleString('en-US'), }; this.noteService.addNote(this.id, newNote).subscribe((newID) => {