Set Date Picker with correct format

Forums Autocomplete Set Date Picker with correct format


This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 11 months ago.

  • Author
  • #23075

    Shane Miller

    Hello Alexander,
    I am using Autocomplete to set a date picker field of a related list item. the format after setting the field comes out as YYYY-MM-DD 0. Any help you could provide on how to format this would be very helpful. Below is the Autocomplete from the custom JS tab. Thank you very much for your help.{
    “applyTo”: “exerciseName”,
    “helpText”: “Copy and Paste Exercise name here…”,
    “loadText”: “”,
    “listGuid”: “{5069237B-77D7-4E64-9120-DCE5AF2125DC}”,
    “listBaseUrl”: “/sites/XT”,
    “showField”: “Generated_x0020_Exercise_x0020_I”,
    “searchFields”: [],
    “filterCAML”: “<Where><Geq><FieldRef Name=’Exercise_x0020_Start_x0020_Date’/><Value Type=’DateTime’ IncludeTimeValue=’FALSE’><Today /></Value></Geq></Where>”,
    “useREST”: false,
    “filterREST”: “”,
    “optionDetailFields”: [],
    “optionDetailPrefix”: [],
    “enforceUniqueValues”: true,
    “rowLimit”: 15,
    “listOptionsOnFocus”: false,
    “minLengthBeforeSearch”: 3,
    “reValidateOnLoad”: false,
    “allowAddNew”: false,
    “isLookupInSelf”: false,
    “addNewAdditionalFields”: [],
    “multiselect”: false,
    “multiselectSeparator”: “; “,
    “orderBy”: [],
    “clearSetFieldsOnInvalidSelection”: false,
    “setFields”: [
    “debug”: false

  • #23083

    Alexander Bautz

    You must use the parseFunction like this:

    function fixDateValue(s){
        var date = new Date(s[0]);
        // Fix the returned format to match your current date format
        return  (date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear();


You must be logged in to reply to this topic.