I have some flask code which renders a html document like this
html = render_template('test.html', data=data)
where test.html is given by
<div>
{{ moment(data.date).fromNow() }}
</div>
I am using the moment.js file to print the time difference between now and the date. However, in the example above the moment function does not work. I tried to include the moment function into the template like
{% block scripts %}
{{ moment.include_moment() }}
{% endblock %}
but this does not seem to do the trick... how can I get a javascript function to work in this context?