Edit input Date field in nodeJS form adding records to mongoDB...how to? #2003
Unanswered
ashBassili
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
New programmer...and probably stupid plea for guidance. I have an input form in a nodeJS app. Would really appreciate guidance on functions to use.
End Result Desired - I would like to standardize all dates going into the database as YYYY/MM/DD.
The Ask - I'm confused as to what functions to use or how to do so using date-fns functions or how to initiate that from the form?
Is this the right approach:
format(stringCapturedOnForm, 'yyyy-MM-dd')
P.S. Would you define the date field in the mogoDB schema as a Date, Number or String?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions