Case
Posts: 0
Joined: Mon Mar 10, 2014 12:08 am

Date picker wont map to 'date' date type in database

I have a simple signup form during registration that contains a datapicker for users to select their birthdates when they sign up. In my Users collection I created a new column called 'birthday' with type DATE and mapped the picker to that column.

However on signup I get an error that the date format is invalid (only way to succeed registration is to clear the date from picker). I tried adjusting the format to what it seems to want but it still hits error.

Do I need to make my 'birthday' column a string or am I missing something with the way the date should be formatted. Is it something to do with time?

Case
Posts: 0
Joined: Mon Mar 10, 2014 12:08 am

Date picker wont map to 'date' date type in database

Thank you Katya, I missed that thread somehow.

For others who find this one here is my solution:
1) add datePicker on the page. Go to the properties and set date format as "yy/mm/dd".
2) create update or create service.
3) add datasouce for this service.
4) do mapping from "datepicker_date value" - date field in the request.
5) click "edit js".

Add following JS to mapping:
code
value = value.replace(/\//gi, "-") + " 00:00:00.000";
return value;
/code

Return to “Issues”