Page 1 of 1

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

Posted: Thu Apr 10, 2014 7:36 pm
by Case

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?


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

Posted: Thu Apr 10, 2014 8:34 pm
by Kateryna Grynko

Hi Case,

Take a look at here please:
https://getsatisfaction.com/apperyio/...


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

Posted: Thu Apr 10, 2014 9:21 pm
by Case

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