Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#calendar').fullCalendar({
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- events: _this.state.events,
- defaultView:'month',
- displayEventTime: false,
- editable: false,
- droppable: false,
- durationEditable: false
- });
- viewRender: function(view, element) {
- //note: this is a hack, i don't know why the view title keep showing "undefined" text in it.
- //probably bugs in jquery fullcalendar
- $('.fc-center')[0].children[0].innerText = view.title.replace(new RegExp("undefined", 'g'), ""); ;
- },
- [{"start":"2017-03-24T00:00:00.000Z","end":"2017-03-26T00:00:00.000Z","title":"Open house","description":"Bali 1 open house"}]
- @Scripts.Render("~/bundles/dates")
- <script src='//cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js'></script>
- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" />
- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
- <link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css" rel="stylesheet" />
- <link href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.css" rel="stylesheet" />
- <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
- <script src="https://code.jquery.com/jquery-3.2.1.js"
- integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
- crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
- <script src="http://npmcdn.com/[email protected]/dist/js/tether.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/fullcalendar.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.4.0/locale/fr.js"></script>
- <script src="~/Scripts/VisiteCalendar.js"></script>
- $(document).ready(function () {
- var sourceFullView = { url: '/Vue_visite/GetEvents/' };
- //var sourceSummaryView = { url: '/Home/GetDiarySummary/' };
- var CalLoading = true;
- $('#calendar').fullCalendar({
- customButtons: {
- AgendaWeek: {
- text: 'Semaine',
- click: function () {
- $('#calendar').fullCalendar('changeView', 'agendaWeek');
- }
- },
- AgendaDay: {
- text: 'Jour',
- click: function () {
- $('#calendar').fullCalendar('changeView', 'agendaDay');
- }
- }
- },
- header: {
- left: 'prev,next, today',
- center: 'title',
- right: 'month,AgendaWeek,AgendaDay'
- },
- // //editing
- editable: true,
- disableDragging: true,
- disableResizing: true,
- slotLabelFormat: "HH:mm",
- defaultDate: moment(),
- navLinks: true, // can click day/week names to navigate views
- defaultView: 'agendaWeek',
- nowIndicator: true,
- weekends: true,
- weekNumbers: true,
- weekNumbersWithinDays: true,
- showNonCurrentDates: true,
- locale: 'fr',
- lang: 'fr',
- timezone: 'Europe/Paris',
- allDaySlot: false,
- allDayDefault: true,
- eventLimit: true,
- // jquery-ui theming
- theme: false,
- height: 515,
- aspectRatio: 2,
- forceEventDuration: true,
- businessHours: {
- // days of week. an array of zero-based day of week integers (0=Sunday)
- dow: [1, 2, 3, 4, 5], // Monday - Thursday
- start: '8:00', // a start time (10am in this example)
- end: '18:00', // an end time (6pm in this example)
- },
- minTime: "08:00:00",
- maxTime: "18:00:00",
- //selectable: false,
- unselectAuto: true,
- dropAccept: '*',
- handleWindowResize: true,
- events: '/Vue_visite/GetEvents/',
- eventClick: function (event, jsEvent, view) {
- $('#modalTitle').html(event.url);
- $('#modalBody').html(event.descriptionComplete);
- $('#eventUrl').attr('href', event.url);
- $('#fullCalModal').modal();
- },
- dayClick: function (date, allDay, jsEvent, view) {
- $('#eventTitle').val("");
- $('#eventDate').val($.fullCalendar.formatDate(date, 'dd/MM/yyyy'));
- $('#eventTime').val($.fullCalendar.formatDate(date, 'HH:mm'));
- ShowEventPopup(date);
- }
- });});
Advertisement
Add Comment
Please, Sign In to add comment