I want to display just the date as Jun 29, 1967 - but it is coming back to my angular app as 1967-06-28 19:00:00.000 - so it is naturally displaying June 28, 1967.
My HTML form date selector - selected : 06/29/1967
The form is submitted...
MongoDB shows : 1967-06-28 19:00:00.000
I'm in central TZ, so this makes sense as a storage in UTC.
Mongo data type is "Date" defined in the mongoose schema like this:
,dob: {
type: Date
,required: false
,default: null
}
To do the conversion at the browser, I installed - angular2-moment - as it 'advertised' a function to do this very thing. I do not get an error - but I do not get any change in display either.
DOB: {{user.dob | date:'mediumDate' }}
DOB: {{user.dob| amLocal | amDateFormat: 'MMM DD, YYYY'}}
BOTH display
Jun 28, 1967
Ironically - the Date field of the edit form, Displays 06/29/1967...
What am I doing wrong?