I'm trying to take a Date() object and turn it into a proper Firebase timestamp for data. I found this function in the docs but it doesn't work for me. When I try to save as Date(date) it will save as a string instead of timestamp. any help?
firebase
.firestore()
.collection("articles")
.add({
url: url,
archive: archive.docId,
article: articleState,
published: firebase.firestore.Timestamp.fromDate(date);})