This is a migrated thread and some comments may be shown as answers.

formatting hash variables

2 Answers 40 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 18 Jan 2016, 06:27 AM

<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 Answers, 1 is accepted

Sort by
0
Accepted
Petyo
Telerik team
answered on 19 Jan 2016, 01:49 PM
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!
 
0
Joe
Top achievements
Rank 1
answered on 19 Jan 2016, 04:21 PM
Yes, that was it, it works now.  Thank you.
Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Joe
Top achievements
Rank 1
Share this question
or