Skip to content

Commit

Permalink
@small-yellow-rice upgrading the default version to the latest moment…
Browse files Browse the repository at this point in the history
….js release(2.10.3)
  • Loading branch information
small-yellow-rice committed Jun 19, 2015
1 parent d224c03 commit 56102d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flask_moment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

class _moment(object):
@staticmethod
def include_moment(version='2.5.1', local_js=None):
def include_moment(version='2.10.3', local_js=None):
js = ''
if local_js is not None:
js = '<script src="%s"></script>\n' % local_js
elif version is not None:
js_filename = 'moment-with-locales.min.js' if StrictVersion(version) >= StrictVersion('2.8.0') else 'moment-with-langs.min.js'
js = '<script src="//cdnjs.cloudflare.com/ajax/libs/' \
'moment.js/%s/moment-with-langs.min.js"></script>\n' % version
'moment.js/%s/%s"></script>\n' % (version, js_filename)
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 56102d5

Please sign in to comment.