Skip to content

Instantly share code, notes, and snippets.

@fredriccliver
Created August 21, 2020 10:03
Show Gist options
  • Save fredriccliver/45c604733f150281b31bbbc7999f0aff to your computer and use it in GitHub Desktop.
Save fredriccliver/45c604733f150281b31bbbc7999f0aff to your computer and use it in GitHub Desktop.
const now = new Date()
const recipe = {
name: form.recipe.value,
created_at: firebase.firestore.Timestamp.fromDate(now),
}
db.collection("recipes")
.add(recipe)
.then(() => {
console.log("recipe added")
})
.catch((err) => console.log(err))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment