PHPackages                             rundiz/thai-calendar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rundiz/thai-calendar

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

rundiz/thai-calendar
====================

The calendar in Thai language (also support multi languages).

v2.0(10y ago)03229MITPHPPHP &gt;=5.3.0

Since May 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Rundiz/thai-calendar)[ Packagist](https://packagist.org/packages/rundiz/thai-calendar)[ RSS](/packages/rundiz-thai-calendar/feed)WikiDiscussions version2 Synced 3w ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

Thai Calendar
=============

[](#thai-calendar)

The calendar in Thai language (also support multi languages). ปฏิทินภาษาไทย (และรองรับได้หลายภาษา).

[![Latest Stable Version](https://camo.githubusercontent.com/d79a6c86027479774d566deee3f2d72dc63077b263b7a2bacabb64b4ce6f54c0/68747470733a2f2f706f7365722e707567782e6f72672f72756e64697a2f746861692d63616c656e6461722f762f737461626c65)](https://packagist.org/packages/rundiz/thai-calendar)[![License](https://camo.githubusercontent.com/21ab8174a5087d4e675fd02936f51c377959e08e2b183e2c3be0223bb9d0cd52/68747470733a2f2f706f7365722e707567782e6f72672f72756e64697a2f746861692d63616c656e6461722f6c6963656e7365)](https://packagist.org/packages/rundiz/thai-calendar)[![Total Downloads](https://camo.githubusercontent.com/352e8281e509178808d56ac4c62cdb51770b19866d5ac5825874c2c1d526c322/68747470733a2f2f706f7365722e707567782e6f72672f72756e64697a2f746861692d63616c656e6461722f646f776e6c6f616473)](https://packagist.org/packages/rundiz/thai-calendar)

This calendar component can display the calendar in multiple scope such as day, week, month, year. You can add events, or appointments to display in the calendar. To get start is very easy, just set few things to the class properties and display.

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

In this example, it is just displaying the calendar without events or appointments for easy to understand.

```
// If you did not install it via Composer, you have to include/require these files.
require dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Rundiz' . DIRECTORY_SEPARATOR . 'Calendar' . DIRECTORY_SEPARATOR . 'Calendar.php';
require dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Rundiz' . DIRECTORY_SEPARATOR . 'Calendar' . DIRECTORY_SEPARATOR . 'Generators' . DIRECTORY_SEPARATOR . 'GeneratorInterface.php';
require dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Rundiz' . DIRECTORY_SEPARATOR . 'Calendar' . DIRECTORY_SEPARATOR . 'Generators' . DIRECTORY_SEPARATOR . 'GeneratorAbstractClass.php';
// The files below is calendar HTML generator. Choose just only one.
require dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Rundiz' . DIRECTORY_SEPARATOR . 'Calendar' . DIRECTORY_SEPARATOR . 'Generators' . DIRECTORY_SEPARATOR . 'Simple.php';
require dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'Rundiz' . DIRECTORY_SEPARATOR . 'Calendar' . DIRECTORY_SEPARATOR . 'Generators' . DIRECTORY_SEPARATOR . 'Bootstrap3.php';

$Calendar = new \Rundiz\Calendar\Calendar();
// Set your base URL for links to other date/month/year in the same page.
$Calendar->base_url = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
// Set the viewing date to let calendar component knows that what is currently date you are looking at.
$Calendar->viewing_date = (isset($_GET['viewdate']) ? strip_tags($_GET['viewdate']) : date('Y-m-d'));
// Set first day of the week. You can ignore this property because it is set to 0 (Sunday) by default. Set to 0 for Sunday, 1 for Monday to 6 for Saturday.
$Calendar->first_day_of_week = 1;
// Display the calendar.
// The first argument in this method is scope. You can set to 'day', 'week', 'month', 'year'.
// The second argument is the generator class name in case that you want something different.
echo $Calendar->display('day');
// Call to clear to clear and reset everything and make it ready to begins again.
$Calendar->clear();
```

### Use other generator

[](#use-other-generator)

```
$Calendar = new \Rundiz\Calendar\Calendar();
$Calendar->base_url = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$Calendar->viewing_date = (isset($_GET['viewdate']) ? strip_tags($_GET['viewdate']) : date('Y-m-d'));
// We already have 2 generators for you to use. 1 is Simple and 2 is Bootstrap3. Use its class name in second argument of display() method.
echo $Calendar->display('year', '\\Rundiz\\Calendar\\Generators\\Bootstrap3');
$Calendar->clear();
```

### Events, Appointments

[](#events-appointments)

The events or appointments for scope day, week, month, year always use the same array format. Let's see the example.

```
// Assume that today is 2016-05-02.
$events = array (
  array (
    'date_from' => '2016-05-02 00:00:00',
    'date_to' => '2016-05-03 01:00:00',
    'title' => 'Event today to tomorrow +1hr.',
  ),
  array (
    'date_from' => '2016-05-02 00:50:00',
    'date_to' => '2016-05-04 16:00:00',
    'title' => 'Event today to after tomorrow 00:50 to 16:00.',
  ),
  'special_event1' => array (
    'date_from' => '2016-05-03 10:00:00',
    'date_to' => '2016-05-03 15:00:00',
    'title' => 'Event tomorrow with special key name',
  ),
  array (
    'date_from' => '2016-05-03 11:00:00',
    'date_to' => '2016-05-03 15:00:00',
    'title' => 'Event tomorrow 11:00 to 15:00',
  ),
  array (
    'date_from' => '2016-05-03 23:40:00',
    'date_to' => '2016-05-04 02:30:00',
    'title' => 'Event tomorrow to after tomorrow 23:40 to 02:30',
  ),
  array (
    'date_from' => '2016-05-04 08:00:00',
    'date_to' => '2016-05-04 23:59:00',
    'title' => 'Event after tomorrow 08:00 to 23:59',
  ),
  array (
    'date_from' => '2016-05-14',
    'date_to' => '2016-05-14',
    'title' => 'Event next 12 days',
  ),
  array (
    'date_from' => '2016-05-28',
    'date_to' => '2016-06-02',
    'title' => 'Event 28 this month to next 5 days',
  ),
) ;
```

The array key 'date\_from' and 'date\_to' are required, the key 'title' is optional. You can add more array key into this data but you have to create generator yourself to support it. Set to event to the calendar use `setEvents()` method.

```
$Calendar = new \Rundiz\Calendar\Calendar();
$Calendar->base_url = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$Calendar->viewing_date = (isset($_GET['viewdate']) ? strip_tags($_GET['viewdate']) : date('Y-m-d'));
$Calendar->setEvents($events);
echo $Calendar->display('month');
$Calendar->clear();
```

Customize
---------

[](#customize)

### Change locale

[](#change-locale)

You can change the language to use other language (or locale). To do this call to the 'locale' property of Calendar class.

```
$Calendar->locale = array('en_UK.utf8', 'en_UK', 'en');
```

For more information about locale, please take a look at

### First day of week

[](#first-day-of-week)

You can use other day as first day of week instead of Sunday. Set 'first\_day\_of\_week' property to the day number (0 = Sunday, 1 = Monday, 2 = Tuesday, ..., 6 = Saturday)

```
$Calendar->first_day_of_week = 3;// Wednesday as firstday of week.
```

### Buddhist era (ปีพุทธศักราช)

[](#buddhist-era-ปีพุทธศักราช)

You can set to use or not to use Buddhist era (BE). You can also change the difference year of Buddhist era and anno Domini (AD). By default we use 543.

```
$Calendar->use_buddhist_era = true;// Set to false for not to use Buddhist era.
$Calendar->buddhist_era_offset = 543;
$Calendar->buddhist_era_offset_short = 43;// 2016 = 2559, 16 = 59.
```

Screenshots
-----------

[](#screenshots)

### Scope day calendar

[](#scope-day-calendar)

[![Day calendar](https://camo.githubusercontent.com/9a22a236803b6502e48d772d8ec09f3bf7765153dc1c2806bc61a0ffdf8b7b7e/687474703a2f2f692e696d6775722e636f6d2f75716d64346c692e6a7067 "Day calendar")](http://imgur.com/uqmd4li)

### Scope week calendar

[](#scope-week-calendar)

[![Week calendar](https://camo.githubusercontent.com/1f7ae4a104dbff63288bbae4da204528deb3f8e646498acd53f8bb7b8da16090/687474703a2f2f692e696d6775722e636f6d2f4e506530664b712e6a7067 "Week calendar")](http://imgur.com/NPe0fKq)

### Scope month calendar

[](#scope-month-calendar)

[![Month calendar](https://camo.githubusercontent.com/ec2b18c0ad3797b0666fa608564070fcec7d84c6ee619d672e2fe93241cc4ba4/687474703a2f2f692e696d6775722e636f6d2f6d4f704551316a2e6a7067 "Month calendar")](http://imgur.com/mOpEQ1j)

### Scope year calendar

[](#scope-year-calendar)

[![Year calendar](https://camo.githubusercontent.com/d252b1ed77743e5a541463e33807154559f4ac91a39908a5a61a8002f7de7c6e/687474703a2f2f692e696d6775722e636f6d2f666a5547714d7a2e6a7067 "Year calendar")](http://imgur.com/fjUGqMz)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3707d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1568262?v=4)[vee w,](/maintainers/ve3)[@ve3](https://github.com/ve3)

---

Top Contributors

[![ve3](https://avatars.githubusercontent.com/u/1568262?v=4)](https://github.com/ve3 "ve3 (10 commits)")

---

Tags

buddhist-eracalendardateday-calendarmonth-calendarthaiweek-calendaryear-calendareventschedulecalendartaskphp calendarappointmentweek calendarThai calendarday calendarmonth calendaryear calendar

### Embed Badge

![Health badge](/badges/rundiz-thai-calendar/health.svg)

```
[![Health](https://phpackages.com/badges/rundiz-thai-calendar/health.svg)](https://phpackages.com/packages/rundiz-thai-calendar)
```

###  Alternatives

[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.7M21](/packages/spatie-laravel-google-calendar)[fullcalendar/fullcalendar

Full-sized drag &amp; drop event calendar

20.5k374.8k4](/packages/fullcalendar-fullcalendar)[eluceo/ical

The eluceo/iCal package offers an abstraction layer for creating iCalendars. You can easily create iCal files by using PHP objects instead of typing your \*.ics file by hand. The output will follow RFC 5545 as best as possible.

1.2k18.3M57](/packages/eluceo-ical)[league/period

Time range API for PHP

7335.7M22](/packages/league-period)[laraveljutsu/zap

A flexible, performant, and developer-friendly schedule management system for Laravel

1.5k97.9k1](/packages/laraveljutsu-zap)[kigkonsult/icalcreator

iCalcreator is the PHP implementation of rfc2445/rfc5545 and rfc updates, management of calendar information

2462.8M20](/packages/kigkonsult-icalcreator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
