rd-dev-ukraine / angular-io-datepicker

MIT License
21 stars 18 forks source link

not inserting date in database through template driven form approach. #8

Closed aruribadraiah closed 6 years ago

aruribadraiah commented 7 years ago

my html file is

ts file dob = new FormControl(''); this.addCatForm = this.formBuilder.group({ dob:this.dob }); / model file is / import * as mongoose from 'mongoose'; const catSchema = new mongoose.Schema({ dob:Date });

kindly help for not inserting date in the database.

eugenesaenko commented 7 years ago

Datepicker sets date in UTC format like 2017-07-05T00:00:00.000Z. Just sent this value to the server and store it like a string.