I would like to achieve that the Meteor schema accepts a specific date and stores it to MongoDB. It works with the date format "YYYY-MM-DD" without problems. But I would like to use the European Format "DD.MM.YYYY" instead.
This is what I use at the moment:
createdAt:{
type: Date
}
If you're using AutoForm you can use the hook "onSubmit" to format and/or check the format of the input date before attempting to insert/update it in your collection. What may make more sense, however, is to store the date using Moment (linked below) and format the date upon retrieval. This will give you much more flexibility (time zones, custom formatting, fuzzy time ago, etc).
Relevant packages: Moment, AutoForm.
var when = moment(createdAt).utcOffset(createdZoneOffSet);
return when.format('DD.MM.YYYY');