Download the PHP package serhioromano/bootstrap-calendar without Composer

On this page you can find all versions of the php package serhioromano/bootstrap-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 bootstrap-calendar

Bootstrap Calendar

A Full view calendar based on Twitter Bootstrap. Please try the demo.

Bootstrap full calendar

Why?

Why did I start this project? Well, I believe there are no good full view calendar's out there with native Bootstrap support. In fact I could not find even one. A different UI and UX concept approach is also used.

Features

How to use

Install

You can install it with bower package manager.

$ bower install bootstrap-calendar

Bower will automatically install all dependencies. Then by running

$ bower list --path

You will see list of the files you need to include to your document.

Quick setup

You will need to include the bootstrap css and calendar css. Here is the minimum setup.

Bootstrap Calendar depends on jQuery and underscore.js is used as a template engine. For the calendar you only have to include the calendar.css and calendar.js files. If you want to localize your Calendar, it's enough to add this line before including calendar.js:

Where xx-XX is the language code. When you initializing the calendar, you have to specify this language code:

Feed with events

To feed the calendar with events you should use events_source parameter. It may be a function, array or URL. In all cases you have to set it with valid events array.

See events.json.php file for more details.

start and end contain dates when event starts (inclusive) and ends (exclusive) in Unix timestamp. Classes are event-important, event-success, event-warning, event-info, event-inverse and event-special. This wil change the color of your event indicators.

Feed URL

var calendar = $('#calendar').calendar({events_source: '/api/events.php'});

It will send two parameters by GET named from and to, which will tell you what period is required. You have to return it in JSON structure like this

{
    "success": 1,
    "result": [
        {
            "id": 293,
            "title": "Event 1",
            "url": "http://example.com",
            "class": "event-important",
            "start": 12039485678000, // Milliseconds
            "end": 1234576967000 // Milliseconds
        },
        ...
    ]
}

Feed array

You can set events list array directly to events_source parameter.

Feed function

Or you can use function. You have to return array of events.

PHP example

Note that start and end dates are in milliseconds, thus you need to divide it by 1000 to get seconds. PHP example.

If you have an error you can return

Here is the example of PHP script.

Another example of PHP script (without connecting with the Database).

Usage warning.

You cannot use the calendar from a local file. The following error will be displayed : Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.

Using Ajax with local resources (file:///), is not permited. You will need to deploy this to the web instead.

Modal popup

You can enable a bootstrap modal popup to show when clicking an event instead of redirecting to event.url. To enable boostrap modal, first add the modal html to your page and provide boostrap-calendar with the ID:

and then set:

modal: "#events-modal"

This will enable the modal, and populate it with an iframe with the contents of event.url .

For Bootstrap v3, use

Modal content source

There are three options for populating the contents of the modal, controlled by the modal_type option:

Modal title

The modal title can be customized by defining the modal_title option as a function. This function will receive the event as its only parameter. For example, this could be used to set the title of the modal to the title of the event:

modal_title: function(event) { return event.title }

A calendar set up to use modals would look like this:

$("#calendar").calendar({modal : "#events-modal", modal_type : "ajax", modal_title : function (e) { return e.title }})

All versions of bootstrap-calendar with dependencies

PHP Build Version
Package Version
Requires components/jquery Version ~1
components/underscore Version ~1
twbs/bootstrap Version >2.0.0
moment/moment Version ~2
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 serhioromano/bootstrap-calendar contains the following files

Loading the files please wait ....