Question: I have started using mustache.js and so far I am very impressed. Although two things puzzle me. The first leads on to the second so bear with me.

**My JSON** 

```
{"goalsCollection": [
    {
        "Id": "d5dce10e-513c-449d-8e34-8fe771fa464a",
        "Description": "Multum",
        "TargetAmount": 2935.9,
        "TargetDate": "/Date(1558998000000)/"
    },
    {
        "Id": "eac65501-21f5-f831-fb07-dcfead50d1d9",
        "Description": "quad nomen",
        "TargetAmount": 6976.12,
        "TargetDate": "/Date(1606953600000)/"
    }
]};

```

**My handling function**

```
function renderInvestmentGoals(collection) {
    var tpl = '{{#goalsCollection}}<tr><td>{{Description}}</td><td>{{TargetAmount}}</td><td>{{TargetDate}}</td></tr>{{/goalsCollection}}';
    $('#tblGoals tbody').html('').html(Mustache.to_html(tpl, collection));
}

```

**Q1**
As you can see my 'TargetDate' needs parsing but I am unsure of how to do that within my current function.

**Q2**
Say I wanted to perform some function or formatting on one or more of my objects before rendering, what is the best way of doing it?

Answer: 
I have created a small extension for Mustache.js which enables the use of formatters inside of expressions, like {{expression | formatter}}

You would anyway need to create a function that parses your date value like this:

```

      Mustache.Formatters = {
        date: function( str) {
          var dt = new Date( parseInt( str.substr(6, str.length-8), 10));
          return (dt.getDate() + "/" + (dt.getMonth() + 1) + "/" + dt.getFullYear());
        }
      };

```

And then just add the formatter to your expressions:

```
{{TargetDate | date}}

```

You can grab the code from here: <http://jvitela.github.io/mustache-wax/>
I've been using Mustache for my projects as well, due to its ability to be shared across client/server. What I ended up doing was formatting all values (dates, currency) to strings server-side, so I don't have to rely on helper Javascript functions. This may not work well for you though, if you're doing logic against these values client-side.

You might also want to look into using [handlebars.js](http://handlebarsjs.com/), which is essentially Mustache, but with extensions that may help with client-side formatting (and more). The loss here is that you will probably not be able to find a server-side implementation of handlebars, if that matters to you.