For partial overwriting (hiding) of fullcalendar periodic event dow.

Asked 2 years ago, Updated 2 years ago, 85 views

I have a stuck question about the fullcalendar event.

WHAT YOU WANT TO DO
1, Get National Holidays from Google
2. Display staff's weekly work days in calendar [ ] (implemented in eventSources as dow) ← Implemented so far.
3. I would like to avoid displaying staff working days on company holidays.(←I'm stuck here.)

fullcalendar
The following code

<script src='js/moment.min.js'></script>
  <script src='js/fullcalendar.js'></script>
  <script src='js/ja.js'></script>
<script>
  $(function(){
  $('#calendar').fullCalendar({
    firstDay: 1,
    timeFormat: 'H:mm',
    axisFormat: 'H:mm',
  eventSources: [
    {
      url: 'data/json1.php', // I'm getting Google holidays here.
      dataType: 'json',
    },
    {
      url: 'data/json2.php', // 11
      dataType: 'json',
      async —false,
      type: 'POST',
      data: {
        id: "1",
        id2: "100",
      },
    },
  ]
  });
});
</script>

1 Part 1

 Some omissions (refer to ID at POST)
  $list = array();
  $i = 0;
    foreach($app->getValues()->staff_all as $staff){
    $list[$i]['title'] = "Workday";
    $list[$i]['color']="blue";
    $list[$i]['start'] = $staff->in_time;//work hours
    $list[$i]['end'] = $staff->out_time;// End time
    $list[$i]['down']="[".$staff->in_yobi.]";// Specify weekly days
    $i++;
  }
  header('Content-Type:application/json; charset=utf-8');
  echo json_encode($list);

I have a weekly schedule with the code above, but
In line with that, I would like to make sure that my company's public holidays are not displayed. I'm at a standstill because I don't know what code to add.
I'm not good at English. fullcalendar
I'm looking at , but I can't find a solution
I would appreciate it if you could let me know.

Environment
php 5.6
mysql 5.6
fullcalendar-3.7.0

javascript php jquery mysql fullcalendar

2022-09-30 19:13

1 Answers

When extracting the schedule from DB, why don't we use SQL to exclude public holidays?
Can't I change SQL?

The rest is
I think it is possible not to display the fullcalendar event drawing timing on the calendar.
Allow JSON to determine including public holiday information

eventRender:function(event,element){
    if(event.Public Holiday Discrimination Flag == true){
        return false;//Leave event drawing
    }
},


2022-09-30 19:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.