Link to home
Start Free TrialLog in
Avatar of Dhananjay Malipatil
Dhananjay Malipatil

asked on

Need to Show next dates only and calender must start with today date.

I need to start the calender with date & it must shows next 30 dates only.

can anyone please help me out from this.
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

What calendar?
Avatar of Dhananjay Malipatil
Dhananjay Malipatil

ASKER

I have used fullcalendar
I am not familiar with fullcalendar. Without source code or a link to a site that demonstrates the problem I am unable to assist.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link href='../fullcalendar.min.css' rel='stylesheet' />
<script src='../lib/moment.min.js'></script>
<script src='../lib/jquery.min.js'></script>
<script src='../fullcalendar.min.js'></script>
<script>

var cal=$('#calendar').fullCalendar({

theme: false,
firstDay: 0,
isRTL: false,
fixedWeekCount: false,
weekNumbers:false,
height: 'auto',
contentHeight:'auto',
aspectRatio:'1.35',
header: {
        left: 'today',
        center: 'title',
        right: 'month'
      },
     
  eventSources: [
    {
      url: 'myfeed.php', // use the `url` property
      color: 'yellow',    // an option!
      textColor: 'black'  // an option!
          
    }
  ]

});

</script>
<style>

  body {
    margin: 0;
    padding: 0;
    font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
    font-size: 14px;
  }

  #script-warning {
    display: none;
    background: #eee;
    border-bottom: 1px solid #ddd;
    padding: 0 10px;
    line-height: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    color: red;
  }

  #loading {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
  }

  #calendar {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 10px;
  }

</style>
</head>
<body>

  <div id='script-warning'>
    <code>php/get-events.php</code> must be running.
  </div>

  <div id='loading'>loading...</div>

  <div id='calendar'></div>

</body>
</html>


myfeed.php

<?php
header("content-type: application/json");
    $post_data = array();

    //add first event
    $post_data[] = array('title' => 'Test', 'start' => '2018-03-09');
    $post_data[] = array('title' => 'Test', 'start' => '2018-03-20');
    $post_data[] = array('title' => 'Test', 'start' => '2018-03-09');
    $post_data[] = array('title' => 'Test', 'start' => '2018-03-09');

    //add second event
  //  $post_data[] = ...

    echo json_encode($post_data);  
?>
You can find Source code Here :

https://fullcalendar.io/download
ASKER CERTIFIED SOLUTION
Avatar of Misha
Misha
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There is no activity on this question from author 14 days.