Calendar widget binding isn't funky

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

    Posted 23 May 2012 Link to this post

    It's a list of items, the calendar is bound to a date value on the "SelectedItem"

    So when selected item changes I want to show the value in the calendar.

    However what's happening is that the calendar just keeps animating (rather choppy) back to may 2012 over and over with no selected dates.

    This is the date value I'm binding to "2013-04-01T00:00:00"

    Here's the markup
    <li>Starts: <span data-role="calendar" data-bind="value: selectedBlock.data.StartDate"></span></li>

    ideally i'd like no animation, and just want to visualize the dates
  2. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 23 May 2012 Link to this post

    ...oh wait, is it becasue the "date" is a string and not a JS date?

    **Edit**
    Yeah seems that way...well hmm...I'm not sure how to handle this...
    All the data is coming down as json, how do I go about converting and binding to the pure date over the string?
  3. Kendo UI is VS 2017 Ready
  4. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 23 May 2012 Link to this post

    So I can see I can change it with a template
    #: new Date(get("StartDate")).format("MMM dd, yyyy") #

    ...but that doesn't seem to be bound to the data in that when I change StartDate this template gets evaluated again

    Just for the heck of it I tried this too :)
    <span class="blockDate" data-bind="template : '#: new Date(get("StartDate")).format("MMM dd, yyyy") #'"></span>
Back to Top