Skip to content

Instantly share code, notes, and snippets.

@meGAmeS1
meGAmeS1 / django-bootstrap3-datetimepicker Moment Locale Workaround
Last active November 25, 2015 13:34
Because I couldn't get the user locale working with django-bootstrap3-datetimepicker, I created this little workaround (that I put in the <head></head> of my main template).
{% get_current_language as LANGUAGE_CODE %}
<script type="text/javascript">
$(function () {
$.fn.datetimepicker.defaults.locale = moment.locale('{{ LANGUAGE_CODE }}');
});
</script>