formatting hash variables

3 posts, 1 answers
  1. Joe
    Joe avatar
    9 posts
    Member since:
    Jan 2016

    Posted 18 Jan Link to this post

    <script id="detail-template" type="text/x-kendo-template">
      <div class='shipping-details'>
        <ul>
          <li><label>Applied:</label>kendo.toString(#= Applied #, "MM-dd-yyyy" )</li>
        </ul>
      </div>
    </script>

     

    I have a DateTime field in my model which I want to format.  How do you do this in 'UI for ASP.NET MVC' and how do you format kendo # variables in general?

    'kendo.' is not recognized in the "text/x-kendo-template", #= Applied # is and displays the full DateTime.

     

     

     

  2. Answer
    Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 19 Jan Link to this post

    Hi,

    I think that you are looking for something like this:

          <li><label>Applied:</label>#=  kendo.toString(Applied, "MM-dd-yyyy" ) #</li>

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Joe
    Joe avatar
    9 posts
    Member since:
    Jan 2016

    Posted 19 Jan in reply to Petyo Link to this post

    Yes, that was it, it works now.  Thank you.
Back to Top