Coder Social home page Coder Social logo

openwebx / simplecalendar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donatj/simplecalendar

0.0 2.0 0.0 76 KB

A simple PHP calendar rendering class

Home Page: http://donatstudios.com

License: MIT License

Ruby 5.13% PHP 85.22% CSS 9.65%

simplecalendar's Introduction

Simple Calendar

Latest Stable Version License Scrutinizer Code Quality Code Coverage Build Status

A very simple, easy to use PHP calendar rendering class.

Requirements

  • php: >=7.0.0
  • ext-calendar: *

Installing

Install the latest version with:

composer require 'openWebX/simplecalendar'

Sample Usage

<?php
$Calendar = new SimpleCalendar\Calendar('June 2010');
$Calendar->show();

or

<?php
$Calendar = new ew SimpleCalendar\Calendar();
$Calendar->setDate('June 5 2010');
$Calendar->show();

Documentation

Class: \donatj\SimpleCalendar

Simple Calendar

<?php
namespace donatj;

class SimpleCalendar {
	/**
	 * Array of Week Day Names
	 * @var array|false
	 */
	public $wday_names = false;
}

Method: SimpleCalendar->__construct

function __construct([ $date_string = null])

Constructor - Calls the setDate function

Parameters:
  • null | string $date_string

Method: SimpleCalendar->setDate

function setDate([ $date_string = null])

Sets the date for the calendar

Parameters:
  • null | string $date_string - Date string parsed by strtotime for the calendar date. If null set to current timestamp.

Method: SimpleCalendar->addDailyHtml

function addDailyHtml($html, $start_date_string [, $end_date_string = null])

Add a daily event to the calendar

Parameters:
  • string $html - The raw HTML to place on the calendar for this event
  • string $start_date_string - Date string for when the event starts
  • null | string $end_date_string - Date string for when the event ends. Defaults to start date

Method: SimpleCalendar->clearDailyHtml

function clearDailyHtml()

Clear all daily events for the calendar


Method: SimpleCalendar->setStartOfWeek

function setStartOfWeek($offset)

Sets the first day of the week

Parameters:
  • int | string $offset - Day to start on, ex: "Monday" or 0-6 where 0 is Sunday

Method: SimpleCalendar->show

function show([ $echo = true])

Returns/Outputs the Calendar

Parameters:
  • bool $echo - Whether to echo resulting calendar
Returns:
  • string - HTML of the Calendar

simplecalendar's People

Contributors

donatj avatar openwebx avatar bitdeli-chef avatar inod avatar shrimp2t avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.