Skip to content
Snippets Groups Projects
Verified Commit 70867c68 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Use djangojs i18n in datepicker setup

parent 3968fe2c
No related branches found
No related tags found
1 merge request!134Resolve "Add i18n for materialize datepicker"
......@@ -8,8 +8,8 @@ $(document).ready( function () {
// Initialize datepicker [MAT]
$('.datepicker').datepicker({
format: 'dd.mm.yyyy',
// Translate to German
format: get_format('SHORT_DATE_FORMAT'),
// Pull translations from Django helpers
i18n: {
months: calendarweek_i18n.month_names,
monthsShort: calendarweek_i18n.month_abbrs,
......@@ -18,13 +18,13 @@ $(document).ready( function () {
weekdaysAbbrev: calendarweek_i18n.day_abbrs.map(([v])=> v),
// Buttons
today: 'Heute',
cancel: 'Abbrechen',
done: 'OK',
today: gettext('Today'),
cancel: gettext('Cancel'),
done: gettext('OK'),
},
// Set monday as first day of week
firstDay: 1,
firstDay: get_format('FIRST_DAY_OF_WEEK'),
autoClose: true
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment