display bound value of date field formatted as short date

2 posts, 0 answers
  1. Rick
    Rick avatar
    21 posts
    Member since:
    Jul 2015

    Posted 07 Dec 2015 Link to this post

    A search did not show up anything on my problem. I have a database date field I want to display on a form. I don't want to use an input datepicker. I just want to display a readonly short datetime. Things like the created and modified dates for a record.

    I feel silly not finding this right away.

    I hope somebody has done this before and it is easy.

    Thanks,

    Rick

  2. Rick
    Rick avatar
    21 posts
    Member since:
    Jul 2015

    Posted 08 Dec 2015 in reply to Rick Link to this post

    Figured out one way: text binding with a forced calculation of the dependent field in the soon to be bound viewModel.

    <span class="k-textbox" data-bind="text: cr.CreatedShortDate"></span>
     
    with
     
    viewModel.cr.CreatedShortDate = kendo.toString(viewModel.cr.Created, "g"); 

    If I can get this calculation to occur automatically it would be great.

    Rick

  3. Kendo UI is VS 2017 Ready
Back to Top