Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created October 17, 2014 13:32
Show Gist options
  • Save ScullWM/64ba5f31653648ade15e to your computer and use it in GitHub Desktop.
Save ScullWM/64ba5f31653648ade15e to your computer and use it in GitHub Desktop.
Momentjs basic usage
<script>
moment.locale('fr');
var now = moment();
$('.time').each(function(i, e) {
var time = moment($(e).text(), $(e).data('moment-format'));
$(e).html(time.from(now));
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment