Date = Date in the template :/

2 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 19 Oct 2012 Link to this post

    Ok so the data object I have to bind to (remote data, have no control over it) has a property called "Date", and since it's also sending me dates in ISO format I need to do one of these

    #= kendo.toString(new Date(data.Date), 'hh:sstt') #

    However the error thrown is "Date is not a function"

    I do this same thing in another similar object whos date property is PublishedDate (not "Date") and the above code works I assume its the ambiguous naming.

    Is there anything I can do outside of telling telligent community server to change their REST API :)
  2. Dimo
    Dimo avatar
    8322 posts

    Posted 22 Oct 2012 Link to this post

    Hello Steve,

    Our templates by default use a with statement, which extends the scope chain of the model.

    The purpose of this approach is to reference the model properties directly and more easily.

    You can try setting useWithBlock to false, as described at

    If controlling how the template is created is not possible, another (even easier) option is to use window.Date() instead of just Date().

    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top