AC
Posts: 0
Joined: Wed Oct 08, 2014 8:53 pm

how to send the date value as string to database

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

how to send the date value as string to database

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.

AC
Posts: 0
Joined: Wed Oct 08, 2014 8:53 pm

how to send the date value as string to database

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/...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

how to send the date value as string to database

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.

Return to “Issues”