Date object in meteor and autoform

I have problem with input Date validation on Meteor, AutoForm and Simple-schema .
I want to add 2 date in user collection in meteor js and give formate like show in image.but value is null

I want to give date format in date type like 08.01.2016
Format work but when set date value return null

Hi @bipin - please share code showing the issue (it’s much easier to get help that way).

uservalid: { type: Object, minCount: 1, maxCount: 1 }, "uservalid.from": { type: Date, autoform: { placeholder: 'Enter Uservalid From Date' }, label:'Uservalid From', }, "uservalid.to": { type: Date, autoform: { placeholder: 'Enter Uservalid To Date' }, label:'Uservalid To', }

Set date time picker like this
var from_dateid='input[name="profile.uservalid.from"]'; var to_dateid='input[name="profile.uservalid.to"]'; $(from_dateid).datepicker({ dateFormat: 'dd.mm.yy', }); $(to_dateid).datepicker({ dateFormat: 'dd.mm.yy', });

Can you also show your AutoForm inclusion or block tag line? (e.g. {{> quickForm ...}} or {{#autoForm ... }})

{{#autoForm id='updateForm' collection="Meteor.users" doc=selectedUserDoc type="method" meteormethod="UpdateMeteorUser"}} {{> afQuickField name='_id' autofocus='' type='hidden'}} {{> afQuickField name='username' autofocus='' }} {{> afQuickField name='services.$.password' autofocus='' type='password'}} {{> afQuickField name='emails.0.address' autofocus='' }} {{> afQuickField name='profile' autofocus='' }} <center><button type="submit" class="wizard-submit-button btn btn-info ">Submit</button></center> {{/autoForm}}

`
Userschema = {};
Userschema.UserProfile = new SimpleSchema({

uservalid: {
    type: Object,
    minCount: 1,
    maxCount: 1
},
 "uservalid.from": {
    type: Date,
    autoform: {
        placeholder: 'Enter Uservalid From Date'
    },
    label:'Uservalid From',
},
"uservalid.to": {
    type: Date,
    autoform: {
        placeholder: 'Enter Uservalid To Date'
    },
    label:'Uservalid To',
}

});

Userschema.Userconfirm = new SimpleSchema({
profile: {
type: Userschema.UserProfile,
},
});`

If I give format 'yy-mm-dd’ then work but i want to ‘dd.mm.yy’ format

Well if that’s the case I’m going to guess that the date picker library you’ve picked is using a regex to extract the date parts of the set format. Using “.” is likely throwing that regex off. Maybe try escaping the “.”, consider moving away from using “.”, or look for another library that handles this differently.

i also try dd/mm/yy but problem is same

Okay - let’s start to rule things out; have you added some logging in your UpdateMeteorUser method, dumping the contents of the incoming doc object? When you do, do you see the incoming selected date properly? If so we can rule out the date picker and go from there.

it not only problem at update time also give problem to add user