Pass framework7's handlebar variable to function

Hi
In a virtual list, I have a variable called duration which is in milliseconds.
I have a simple function which will convert it to minutes:seconds

How can I pass that variable to the function?

       function success(list){
          var virtualList = app.virtualList.create({
            // List Element
            el: '.virtual-list',
            // Pass array with items
            items: list,
            // List item Template7 template
            itemTemplate:
              '<li>' +
                '<a href="#" class="item-link item-content">' +
                  '<div class="item-inner">' +
                    '<div class="item-title-row">' +
                      '<div class="item-title">{{name}}</div>' +

                      // How to pass handlebar variable?
                      '<div class="item-after">'+millisToMinutesAndSeconds(parseInt('+{{duration}}+', 10))+'</div>' +
                    '</div>' +
                    '<div class="item-title-row">' +
                      '<div class="item-subtitle">{{artist}}</div>' +
                    '</div>' +
                    
                  '</div>' +
                '</a>' +
              '</li>',
            // Item height
            height: app.theme === 'ios' ? 63 : 73,
          });
        }

        function millisToMinutesAndSeconds(millis) {
          var minutes = Math.floor(millis / 60000);
          var seconds = ((millis % 60000) / 1000).toFixed(0);
          return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
        }

As you can see, that wont work. How can I get the value and pass it to my function millisToMinutesAndSeconds?

You need to register custom Template7 helper (http://idangero.us/template7/) or use itemRender function instead of itemTemplate