2018-10-25 16:51:20 +02:00
|
|
|
/* eslint-disable
|
|
|
|
no-undef,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
2018-10-25 16:50:16 +02:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* DS207: Consider shorter variations of null checks
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2018-11-21 11:08:53 +01:00
|
|
|
'use strict';
|
2016-07-13 19:12:16 +02:00
|
|
|
|
2018-10-25 16:50:16 +02:00
|
|
|
Application.Services.factory('CalendarConfig', [() =>
|
2018-10-25 16:51:20 +02:00
|
|
|
function (options) {
|
2018-10-25 16:50:16 +02:00
|
|
|
// The calendar is divided in slots of 1 hour
|
2018-11-21 11:08:53 +01:00
|
|
|
if (options == null) { options = {}; }
|
|
|
|
const BASE_SLOT = '01:00:00';
|
2016-07-13 19:12:16 +02:00
|
|
|
|
2018-10-25 16:50:16 +02:00
|
|
|
// The calendar will be initialized positioned under 9:00 AM
|
2018-11-21 11:08:53 +01:00
|
|
|
const DEFAULT_CALENDAR_POSITION = '09:00:00';
|
2016-07-13 19:12:16 +02:00
|
|
|
|
2018-10-25 16:50:16 +02:00
|
|
|
const defaultOptions = {
|
|
|
|
timezone: Fablab.timezone,
|
|
|
|
lang: Fablab.fullcalendar_locale,
|
|
|
|
header: {
|
|
|
|
left: 'month agendaWeek',
|
|
|
|
center: 'title',
|
2016-07-13 19:12:16 +02:00
|
|
|
right: 'today prev,next'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
|
|
|
firstDay: 1, // Week start on monday (France)
|
|
|
|
scrollTime: DEFAULT_CALENDAR_POSITION,
|
|
|
|
slotDuration: BASE_SLOT,
|
|
|
|
allDayDefault: false,
|
2018-10-25 16:51:20 +02:00
|
|
|
minTime: '00:00:00',
|
|
|
|
maxTime: '24:00:00',
|
2018-10-25 16:50:16 +02:00
|
|
|
height: 'auto',
|
|
|
|
buttonIcons: {
|
|
|
|
prev: 'left-single-arrow',
|
2016-07-13 19:12:16 +02:00
|
|
|
next: 'right-single-arrow'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
|
|
|
timeFormat: {
|
2018-10-25 16:51:20 +02:00
|
|
|
agenda: 'H:mm',
|
2016-07-13 19:12:16 +02:00
|
|
|
month: 'H(:mm)'
|
2018-10-25 16:50:16 +02:00
|
|
|
},
|
|
|
|
axisFormat: 'H:mm',
|
2016-07-13 19:12:16 +02:00
|
|
|
|
2018-10-25 16:50:16 +02:00
|
|
|
allDaySlot: false,
|
|
|
|
defaultView: 'agendaWeek',
|
2016-07-13 19:12:16 +02:00
|
|
|
editable: false
|
2018-11-21 11:08:53 +01:00
|
|
|
};
|
2016-07-13 19:12:16 +02:00
|
|
|
|
2018-11-21 11:08:53 +01:00
|
|
|
return Object.assign({}, defaultOptions, options);
|
2018-10-25 16:50:16 +02:00
|
|
|
}
|
|
|
|
|
2018-11-21 11:08:53 +01:00
|
|
|
]);
|