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.
Dhananjay MalipatilPHP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
What calendar?
0
Dhananjay MalipatilPHP DeveloperAuthor Commented:
I have used fullcalendar
0
Julian HansenCommented:
I am not familiar with fullcalendar. Without source code or a link to a site that demonstrates the problem I am unable to assist.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Dhananjay MalipatilPHP DeveloperAuthor Commented:
<!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);  
?>
0
Dhananjay MalipatilPHP DeveloperAuthor Commented:
You can find Source code Here :

https://fullcalendar.io/download
0
MishaProgrammerCommented:
Try this:

$('#calendar').fullCalendar({
 	viewRender: function(currentView){
		var minDate = moment(),
		maxDate = moment().add(30,'days');
// or maxDate = moment().add(4,'weeks');
		// Past
		if (minDate >= currentView.start && minDate <= currentView.end) {
			$(".fc-prev-button").prop('disabled', true); 
			$(".fc-prev-button").addClass('fc-state-disabled'); 
		}
		else {
			$(".fc-prev-button").removeClass('fc-state-disabled'); 
			$(".fc-prev-button").prop('disabled', false); 
		}
		// Future
		if (maxDate >= currentView.start && maxDate <= currentView.end) {
			$(".fc-next-button").prop('disabled', true); 
			$(".fc-next-button").addClass('fc-state-disabled'); 
		} else {
			$(".fc-next-button").removeClass('fc-state-disabled'); 
			$(".fc-next-button").prop('disabled', false); 
		}
	}
});

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gobinath rajuCommented:
Try using the excellent Datejs JavaScript date library (the original is no longer maintained so you may be interested in this actively maintained fork instead):

Date.today().add(-30).days(); // or...
Date.today().add({days:-30});

[Edit]

See also the excellent Moment.js JavaScript date library:

moment().subtract(30, 'days'); // or...
moment().add(-30, 'days');
0
MishaProgrammerCommented:
There is no activity on this question from author 14 days.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.