SimpleCalendar
- Comments:
- 24
- Tags:
SimpleCalendar is a very simple PHP calendar class written to be easy to use and flexible.
It includes basic event logic and is made to be modified to your particular needs.
Sample Usage
<?php
require_once('SimpleCalendar.php');
$calendar = new donatj\SimpleCalendar();
$calendar->setStartOfWeek('Sunday');
$calendar->addDailyHtml( 'Sample Event', 'today', 'tomorrow' );
$calendar->show(true);
Example Calendar
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
Sample Event | Sample Event | |||||
Click here for the Github repository.
Recent Activity
Jesse Donat (donatj)
Updates docsGitHub (web-flow)
Merge pull request #22 from donatj/8_2Test in PHP 8.2
Jesse Donat (donatj)
Resolve PHP 8.1+ deprecation noticeGitHub (web-flow)
Test in PHP 8.2Merge pull request #21 from donatj/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Create dependabot.yml
Update composer.json
Jesse Donat (donatj)
Clean up setCalendarClasses usageCleans up docs a pinch
Cleans up test a bit
GitHub (web-flow)
Merge pull request #18 from donatj/donatj-patch-1-1Test in PHP 8.1
Test in PHP 8.1
Merge pull request #16 from donatj/donatj-patch-1
Create ci.yml
Jesse Donat (donatj)
Remove TravisCompatible exception testing
Install the latest phpunit
Fix tests
Create ci.yml
GitHub (web-flow)
Delete FUNDING.ymlMoved to global .github repo
Create FUNDING.yml
Jesse Donat (donatj)
Removes unhelpful docsTest exception
Cleans up / unifies interfaces
Improve addDailyHtml
Doc fixes
GitHub (web-flow)
Merge pull request #12 from donatj/1.x1.x - Refactor / Rewrite
Jesse Donat (donatj)
Merge branch 'ben182-master' into 1.xMerge branch 'master' of https://github.com/ben182/SimpleCalendar into ben182-master
# Conflicts:
# lib/donatj/SimpleCalendar.php
Fixup
Build | Date | Message |
---|---|---|
v0.7.0 Download | Updates docs | |
v0.6.2 Download | Merge branch 'keesiemeijer-master' | |
v0.6.1 Download | gitignore updates | |
v0.6.0 Download | Simplified shrimp2ts work | |
v0.5.1 Download | Minor changes to enable selection of the previous/next months | |
v0.5.0 Download | First release by Trialog: add translation to French and improve rendering | |
v0.4.2 Download | Merge pull request #2 from inod/patch-1 Added year check for today date | |
v0.4.1 Download | Slight example cleanup | |
v0.4.0 Download | Added the much requested ability to offset by days! | |
v0.3.2 Download | Fixed a nesting issue | |
v0.3.1 Download | Fixed a problem with the composer JSON | |
v0.3.0 Download | PSR-0, Composer | |
v0.2.0 Download | First tag in a long time, maintence build | |
v0.1.0 Download | Initial Release |
Comment by: Greg Duckworth on
Comment by: Jesse G. Donat on
The constructor on Simple Calendar takes a date string (see strtotime()
) so an easy way is simply
$cal = new SimpleCalendar('+1 Month');
or
$cal = new SimpleCalendar('June 2012');
There is also a setDate method which allows you to change the date of the calendar after initial construction.
Comment by: HvToor on
Hope you can help with it,
Comment by: Jesse G. Donat on
Comment by: Dirk on
Thx in advance
Comment by: Alberto on
"Notice: Undefined offset: 1 in SimpleCalendar.php on line 150"
Comment by: murali on
Thanks.
Comment by: Guilherme on
To change the header,
Sun Mon Tue Wed Thu Fri Sat
To other languages ? what should i do ?
Thanks
Guilherme
Comment by: Brad Haizlett on
Comment by: Jesse G. Donat on
$calendar = new donatj\SimpleCalendar();
$calendar->show(true);
$calendar->setDate('last month');
$calendar->show(true);
$calendar->setDate('next month');
$calendar->show(true);
If you mean button's for next/previous month, thats outside the scope. This is just a little widget to render a calendar. You can write JavaScript or PHP to do it yourself though without too much trouble.
Comment by: Peter on
One question, regarding this line:
$out .= "\n" . ($i != $count ? '
Why did you check ($i != $count?)
In this way, one TR - start is missed.
Br,
Peter
Comment by: Anthony on
If you have update please put it out there.
Comment by: kalle on
Parse error: syntax error, unexpected T_STRING in C:\wamp\www\calendar\donatj\SimpleCalendar.php on line 3
Comment by: Greg on
Comment by: Chris Yates on
I've incorporated this in a pretty complex ERP system and it works great and is easy to expand on