Writes javascript to call momentjs function

def _render(self, value, format):
        """ Writes javascript to call momentjs function """
        template = '<script>\ndocument.write(moment(\"{t}\").{f});\n</script>'
        return Markup(template.format(t=value, f=format))