Skip to content

Commit

Permalink
fixes #8: correct include_moment(version=None) handling
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jun 21, 2014
1 parent 2cf4260 commit e59dae3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flask_moment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class _moment(object):
def include_moment(version = '2.5.1'):
if version is not None:
js = '<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/%s/moment-with-langs.min.js"></script>\n' % version
js = js or ""
return Markup('''%s<script>
function flask_moment_render(elem) {
$(elem).text(eval('moment("' + $(elem).data('timestamp') + '").' + $(elem).data('format') + ';'));
Expand Down

0 comments on commit e59dae3

Please sign in to comment.