1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-15 00:24:09 +01:00
fab-manager/app/assets/javascripts/services/calendar.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-11-21 11:08:53 +01:00
'use strict';
Application.Services.factory('CalendarConfig', [() =>
function (options) {
// 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';
// 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';
const defaultOptions = {
timezone: Fablab.timezone,
lang: Fablab.fullcalendar_locale,
header: {
left: 'month agendaWeek',
center: 'title',
right: 'today prev,next'
},
firstDay: 1, // Week start on monday (France)
scrollTime: DEFAULT_CALENDAR_POSITION,
slotDuration: BASE_SLOT,
allDayDefault: false,
minTime: '00:00:00',
maxTime: '24:00:00',
height: 'auto',
buttonIcons: {
prev: 'left-single-arrow',
next: 'right-single-arrow'
},
timeFormat: {
agenda: 'H:mm',
month: 'H(:mm)'
},
axisFormat: 'H:mm',
allDaySlot: false,
defaultView: 'agendaWeek',
editable: false
2018-11-21 11:08:53 +01:00
};
2018-11-21 11:08:53 +01:00
return Object.assign({}, defaultOptions, options);
}
2018-11-21 11:08:53 +01:00
]);