My application sends the HTML file with javascript as follows:
$(function () {
moment.locale('fr');
$('#datetimepicker9').datetimepicker({
viewMode: 'years',
locale: 'fr',
format: ''
});
});
With the moment I set the locale, is there a way to get the short date format for a configuration like " 'j F Y'" for fr?
I found it, but it hacked:
moment()['_locale']['_longDateFormat']['L']
So now my code is:
$(function () {
moment.locale('fr');
$('#datetimepicker9').datetimepicker({
viewMode: 'years',
locale: 'fr',
format: moment()['_locale']['_longDateFormat']['L']
});
});
I don't like it, is there a clean way to get the format?
source
share