Page 1 of 1

how to send the date value as string to database

Posted: Sun Jan 11, 2015 5:15 am
by AC

Hi, I placed a datepicker UI in the page and I made the current date as default date. I want send the date value that user choose to the database but I failed.

Please tell me how to send the date value to the database as string.

This is the code I used:

var d = Appery("datepicker").getAttr("defaultDateValue"); //(I am not sure the attributes of the datavalue, users may change the default date that I preset. I need to get the real date they picked)

localStorage.setItem('reportdate',text(d));

then I map the local storage variable "reportdate" to the database.


how to send the date value as string to database

Posted: Tue Jan 13, 2015 3:33 am
by Yurii Orishchuk

Hi AC,

You should use following JS code in "before send" mapping, date request parameter JS:

pre

//Note: "datepicker" is your datepicker name.
var d = Appery("datepicker").getAttr("defaultDateValue");

return new Date(d).toISOString().replace(/T.*/gi, "");

/pre

Regards.


how to send the date value as string to database

Posted: Tue Jan 13, 2015 6:38 am
by AC

hi Yurii, ur code works very well. Thanks a lot. I have another question about sending photo_buffer content with email. u used to post some instruction but I failed when I try ur suggestion. Can u help me to check my setting and code?
the link is here https://getsatisfaction.com/apperyio/...


how to send the date value as string to database

Posted: Wed Jan 14, 2015 3:20 am
by Yurii Orishchuk

Hi AC,

Glad it works,

I see Jon helps you with that issue. Please try his suggestion(as i understand he has worked solution).

Regards.