• Andrzej Michalec
    January 24, 2017 at 6:31 am #3560


    I see some issues with Date Picker working in context of AJAX service. Date Picker binds and works on Date, quite obvious. Date object returned by AJAX calls are formatted as string, also obvious. Now, let see what happens when we wire up both ends:

    1) First (working) scenario — Date Picker is bound to date object (e.g. “somedate” from tw.local.somedate) and this variable is bound to Service Call which returns Date object from server. Date comes in ISO8601 conformant format like “2017-01-24T15:10:00Z”. In chain of calls dojo toolkit detects bound variable being “date like” string and automatically converts it to date before it reaches DatePicker.setDate() function. Everything works fine.

    2) Non-working scenario — Date Picker is bound to date from document complex object (e.g. “document.somedate” from tw.local.document) and root document is bound to Service Call. In this case the whole document is replaced but this time date field (“document.somedate”) bound to Date Picker is not processed by dojo and it is passed as string down to Date Picker, which in turn blows up with message like “DatePicker._setDate() error: TypeError: date.getTime is not a function”.

    I would advocate that if date field is stringified (as it happens when JSON is returned from AJAX) then Date Picker should gracefully parse it and turn into date once again in all cases. Optionally Service Call could have an option to provide JSON.parse() reviver to make date conversion on the fly.


    SPARK Support
    January 26, 2017 at 10:14 am #3571


    Thank you for bringing this to our attention.  We are currently investigating this issue and will respond with further information in a timely fashion.


    SPARK Support

    SPARK Support
    January 31, 2017 at 11:10 am #3612

    Hi Andy,

    After reviewing this issue with the Development Team, we have identified a bug with the Date Picker control handling the format of the returned date string.

    A fix for this issue will be provided in an upcoming release.


    Stephen P.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search