Parsing Autocomplete
- This topic has 2 replies, 2 voices, and was last updated 5 years, 4 months ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › vLooup for SharePoint › Parsing Autocomplete
Tagged: Autocomplete JS
I need to format a “YYYY-MM-DD OO:OO:OO” date into “MM/DD/YYYY” when using autocomplete. Here is my code but it will not work.
AC code to set field value:
{
“fromFIN”:”Trainining_x0020_Class_x0020_Dat”,
“joinBy”:””,
“toFIN”:”Date_x0020_of_x0020_Hire”,
“parseFunction”:”parseDateFunc”,
“skipifEmpty”: false
},
Function:
function parseDateFunc(str, fromFIN){
var r = str
var f = a.substring(5,6) + “/” a.substring(8,9) + “/” + a.substring(0,4)
return f;
}
I tried the date example in the documentation but it didn’t work either.
You are missing a + in your code – try it like this:
function parseDateFunc(str, fromFIN){
var r = str;
var f = a.substring(5,6) + "/" + a.substring(8,9) + "/" + a.substring(0,4);
return f;
}
Alexander
OMG…so close and i was done in by a plus sign.
Thank You so much