Oscar
Posts: 0
Joined: Tue Jun 03, 2014 8:22 pm

Date taked from Database doesn't shows in Date input

HI,

I have a Date column in my database and want to show the value in a date input. I set date format to "yy-mm-dd" and the date in database have the format "2014-01-02 00:00:00.000".

I linked the column that stores the date to the "date value" of the date input and I think that this would be enought, but I get this error "Error: Input date must be in'yy-mm-dd' format".

I tried to add some JS to exclude hours, minutes,... but I don't have the value of the response:

The js:
var parts = value.split(" ");
return parts[0];

Error in console:
Uncaught TypeError: Cannot call method 'split' of undefined

What can i do to get the date from database and show it in the date input?

Thanks in advance.

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

Date taked from Database doesn't shows in Date input

Hi Oscar.

Please specify your "Date input" it's a Appery.io Datepicker component?

You mean datepicker please add following JS code to date component mapping:

precode

var newFormat = /(\d+.\d+.\d+)\s/gi.exec(value)[1];

return newFormat;

/code/pre

http://prntscr.com/3pr61e/direct

Regards.

Return to “Issues”