Parsing Autocomplete

Forums vLooup for SharePoint Parsing Autocomplete

Viewing 2 reply threads
  • Author
    Posts
    • #33850
      Paul Heffner
      Participant

      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.

    • #33856
      Alexander Bautz
      Keymaster

      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

    • #33862
      Paul Heffner
      Participant

      OMG…so close and i was done in by a plus sign.

      Thank You so much

Viewing 2 reply threads
  • You must be logged in to reply to this topic.