2014-12-29 12 views
5

Sto tentando di utilizzare l'opzione Ora lavorativa, ma non riesco a riflettere le modifiche.Orario di lavoro completo

voglio visualizzare più le ore di lavoro

ecco il codice;

$('#calendar').fullCalendar({ 
    header: { 
     left: 'prev,next today', 
     center: 'title', 
     right: 'month,agendaWeek,agendaDay' 
    }, 
    defaultDate: '2014-11-12', 
    editable: true, 
    eventLimit: true, // allow "more" link when too many events 
    businessHours: 
     [ 
     { 
    start: '10:00', // a start time (10am in this example) 
    end: '12:00', // an end time (12pm in this example) 
    dow: [ 1,2,3,4 ] 
    // days of week. an array of zero-based day of week integers (0=Sunday) 
    // (Monday-Thursday in this example) 
    }, 
    { 
    start: '12:00', // a start time (12pm in this example) 
    end: '18:00', // an end time (6pm in this example) 
    dow: [ 1,2,3,4 ] 
    // days of week. an array of zero-based day of week integers (0=Sunday) 
    // (Monday-Thursday in this example) 
    }] 
    }); 

risposta

7

in questo modo

businessHours: 
    { 

      start: '11:00', 
      end: '12:00', 
      dow: [ 1, 2, 3, 4, 5] 
    }, 

al fine di utilizzare orari diversi per i diversi turni -> l'uso di fondo eventi

events: 
[ 
    { 
     id: 'available_hours', 
     start: '2015-1-13T8:00:00', 
     end: '2015-1-13T19:00:00', 
     rendering: 'background' 
    }, 
    { 
     id: 'work', 
     start: '2015-1-13T10:00:00', 
     end: '2015-1-13T16:00:00', 
     constraint: 'available_hours' 
    } 
] 

Per ulteriori informazioni, vedere questo link, http://fullcalendar.io/docs/event_ui/eventConstraint/

Ci sono diversi modi in cui puoi avvicinarti s, a seconda di come usi il calendario. Speriamo che la flessibilità dei vincoli ti aiuterà a ottenere ciò che ti serve.

Abbastanza contento questa funzione è finalmente arrivata!

+1

Grazie bro, ho provato il suo bel lavoro, ma la sua non lavorare per più ore lavorative di ogni giorno (intendo cambiare) shift1: 8 -> 12 shift2: 14 -> 20 var BusinessHours = [{"start": '08: 00: 00 ', "fine": '12: 00: 00', "dow": [1, 2, 3, 4] }, { "start": ' 14:00:00 ', "fine": '20: 00: 00', "dow": [1, 2, 3, 4] }]; non funziona –

+1

Raccomando di sfruttare gli eventi in background per quello. Controllali nella documentazione. Funzionano più come eventi, ma puoi quindi collegarli alla funzionalità di altri eventi. Lo aggiungerò alla mia risposta se è ok. – DoverAudio

1

Devo mostrare FixedCaledar Time Slot per 8AM a 8PM, quindi ho eseguito alcune R & D, e ho applicato le seguenti opzioni, e sembra funzionare bene !!! Saluti.

jq('#calendar').fullCalendar({ 
     header: { 
      left: 'prev,next', 
      center: 'title', 
      right: 'today,month,agendaWeek,resourceDay' 
     }, 
     defaultView: 'resourceDay', 
     allDaySlot: false, 
     axisFormat: 'h:mm A', 
     timeFormat: 'h:mm T', 
     minTime: '08:00:00', 
     maxTime: '20:00:00', 

Usa, MINTIME: '08: 00: 00' , MaxTime: '20: 00: 00'

Grazie !!!