arrowcounter/counter/static/js/main.js

53 lines
1 KiB
JavaScript
Raw Normal View History

2018-08-09 16:06:25 +00:00
var i18n = {
cancel: gettext('Cancel'),
clear: gettext('Clear'),
done: gettext('Ok'),
previousMonth: '',
nextMonth: '',
months: [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
],
monthsShort: [],
weekdays: [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'],
weekdaysShort: [],
weekdaysAbbrev: []
};
i18n.months.forEach(function(val, index) {
i18n.months[index] = gettext(val);
i18n.monthsShort[index] = i18n.months[index].substring(0,3);
});
i18n.weekdays.forEach(function(val, index) {
i18n.weekdays[index] = gettext(val);
i18n.weekdaysShort[index] = i18n.weekdays[index].substring(0,3);
i18n.weekdaysAbbrev[index] = i18n.weekdays[index][0];
});
$(document).ready(function() {
$('.sidenav').sidenav();
2018-08-09 16:06:25 +00:00
$('.fixed-action-btn').floatingActionButton();
$('.datepicker').datepicker({
format: 'yyyy-mm-dd',
i18n: i18n
});
});