javascript - calling js function from jsrender template code -


i'm using jsrender javascript template in view. have issue date since i'm getting data json. mytime property displayed this

/date(1395927615038)/ 

so i've tried js function converts date this

<script type="text/javascript">             function convertdate(jsondate) {                 var = jsondate.match(/\d+/);                 var fdate = parseint(a);                 var date = new date(fdate);                 return date;                            };         </script> 

i'm calling function template on same page this

<li>time: {{:convertdate(time)}} </li> 

error occured when calling function

error: data.convertdate not function.

p.s. if it's matters @ all, function convertdate loaded before template code.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -