1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-03 14:24:23 +01:00
fab-manager/app/assets/javascripts/controllers/calendar.coffee

33 lines
1.0 KiB
CoffeeScript

'use strict'
##
# Controller used in the public calendar global
##
Application.Controllers.controller "CalendarController", ["$scope", "$uibModal", "moment", "Availability", 'Slot', 'Setting', 'growl', 'dialogs', 'bookingWindowStart', 'bookingWindowEnd', '_t', 'uiCalendarConfig', 'CalendarConfig'
($scope, $uibModal, moment, Availability, Slot, Setting, growl, dialogs, bookingWindowStart, bookingWindowEnd, _t, uiCalendarConfig, CalendarConfig) ->
### PRIVATE STATIC CONSTANTS ###
### PUBLIC SCOPE ###
## bind the availabilities slots with full-Calendar events
$scope.eventSources = []
$scope.eventSources.push
url: '/api/availabilities/public'
textColor: 'black'
## fullCalendar (v2) configuration
$scope.calendarConfig = CalendarConfig
header:
left: 'month agendaWeek agendaDay'
center: 'title'
right: 'today prev,next'
minTime: moment.duration(moment(bookingWindowStart.setting.value).format('HH:mm:ss'))
maxTime: moment.duration(moment(bookingWindowEnd.setting.value).format('HH:mm:ss'))
]