Download the PHP package garkavenkov/calendar without Composer

On this page you can find all versions of the php package garkavenkov/calendar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package calendar

Сalendar

Calendar

Installation

Use Composer

composer require garkavenkov/calendar

Usage

Initialization

This code creates calendar based on current date. If you need to create calendar on particular month and year, pass parameters to class constructor

By default calendar creates with week begins on Sunday. If you need week begin on Monday, pass next parameter to class constructor

Also you can set language for day's and month's names. In this you need to pass additional parameter to constructor

Calendar structure

To get calendar use command:

The calendar has the following structure:

Methods

getCalendarBoundaries($format)

If you need to get calendar first and last day, use folowing code:

This method returns an array of calendar start and end dates

You can pass $format variable into method.

With this format methods will return array with formated date

getMonthBoundaries($format = null)

Method getMonthBoundaries() returns array with first and last day of the calendar month

Likewise getCalendarBoundaries() you can pass a $format variable to a method and get the formatted dates

getWeekdays()

Method getWeekdays() returns an array containing the names of the days of the week.

getMonths()

Method getMonths() returns an array containing the names of the months.

injectIntoDay(string \$title, array $events, string $array_function)

This method allows to inject data into a day with particular $title. For example, there is a set of data $events containing date and some information e.g.

Following code will inject this dataset into calendar with title todos

output

It is also possible to pass $array_function to perform operation with dataset in $events.

Following code will inject this result of count function performed on dataset into calendar with title todos

output

getWeeksNumbers()

This method returns an array containing calendar's weeks numbers.

output

getWeek(int $number)

This method returns an array containing calendar's week by number $number.

output

getCalendarInfo(string $dateFormat = null)

This method returns an array containing basic information about calendar, i.e. month, year, calendar's and month's boundries

output

It is possible to output calendar's and month's boundries in particular format. To do this, you need to pass a parameter with the necessary format

output

getDay(string $date)

This method returns an array containing particular day information

output


All versions of calendar with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package garkavenkov/calendar contains the following files

Loading the files please wait ....