Working with Calendar Exceptions in PHP

Aspose.Tasks - Adding Calendar Exceptions

To add Calendar Exceptions using Aspose.Tasks Java for PHP, simply invoke AddCalendarException module. Here you can see example code.

 1$project = new Project('test_tasks.mpp');
 2
 3$cal = $project->getCalendars()->toList()->get(0);
 4
 5$calException = new CalendarException();
 6
 7$calendar = new Calendar();
 8
 9$calObject = $calendar->getInstance();
10
11$calObject->set(2009, 1, 1, 0, 0, 0);
12
13$calException->setFromDate($calObject->getTime());
14
15$calObject->set(2009, 1, 3, 0, 0, 0);
16
17$calException->setToDate($calObject->getTime());
18
19$cal->getExceptions()->add($calException);
20
21print "Added calendar exception.";

You can download the working code example from GitHub.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.