kisphp/calendar-bundle

Kisphp calendar bundle

1.0.0 2017-09-09 09:34 UTC

This package is not auto-updated.

Last update: 2024-11-19 16:00:36 UTC


README

Build Status

Installation

composer require kisphp/calendar-bundle

Usage

<?php

use Kisphp\CalendarBundle\Translations\LangRo;
use Kisphp\CalendarBundle\Services\Calendar;

$translation = new LangRo();
$calendar = new Calendar($translation);
$calendar->generateData($year, $month, date('d'));

// get generated days as array
$calendar->getDays();

Add css to your page (Symfony)

<link href="bundles/calendar/css/calendar.css" rel="stylesheet" /> 

Extend calendar

Here is an example on how to make the callendar responsive. All you have to do is to extend the scss file:

$column_width: 100%/7;
$column_height: 35px;
$font-size: 16px;
$active_background: #369;
$active_color: #fff;
$col_border_width: 0;

@import "vendor/kisphp/calendar-bundle/gulp/assets/scss/calendar.scss";

.kisphp-calendar {

  .col {
    &:hover {
      background: #ccc;

      .out {
        color: #fff;
      }
    }

    .active {
      a {
        color: #fff;
      }
    }
    .day {
      a {
        font-weight: bold;

        &:hover {
          color: #a30000;
        }
      }
    }
  }
}