Giter Club home page Giter Club logo

kirby-calendar-plugin's People

Contributors

mnokeefe avatar mzur avatar rmeister avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kirby-calendar-plugin's Issues

How to use with a blueprint?

Hi there,

beginDate [beginTime] [-> endDate [endTime]]:

can you give me an example of a blueprint, which creates this entry? (And I don't mean text, without validation ;) )

Thx, Jan

Example for langkit

Would it be possible to provide an example template for the Kirby langkit (as your plugin uses multilanguage features) which works out of the box with your snippets? I'm a noob and don't get what the calendar.php template file must exactly look like. I followed your installation instructions, but i get the error Undefined variable: calendar when inserting <?php snippet('calendar-table'); ?> in /templates/calender.php.

My langkit content folder:
1-projects
2-blog
3-about
4-contact
5-calendar

These two documents are in 5-calendar:
calendar.de.txt
calendar.en.txt

When i use this code in calendar.php i get the error Call to undefined function calendar():

<?php snippet('header');?>
<?php $calendar = calendar($page->calendar()->yaml());?>
<?php snippet('calendar-table');?>
<?php snippet('footer');?>

and when i use this code in calendar.php i get the error ErrorException (E_NOTICE) Undefined variable: calendar:

<?php snippet('header');?>
<?php $calendar = $page->calendar()->yaml();?>
<?php snippet('calendar-table');?>
<?php snippet('footer');?>

I found this thread in the Kirby forum:

The following code for calendar.php by texnixe works, but how do i get your snippets to work?

<?php snippet('header');?>
<?php
$calendar = $page->calendar()->yaml();
foreach($calendar as $calendarEntry) {
  echo $calendarEntry['description'];
}
?>
<?php snippet('footer');?>

Thanks!

Individual .ics files

Hey there,
is it possible to generate an ical file for every event as single file? I want to loop through all events and add a download link next to each event with its individual .ics file.

Thanks, much appreciated plugin so far.

How can I set this up in the panel?

I'm having trouble installing this plugin. I'm not very experienced with Kirby, so maybe I missed things that are obvious for experienced Kirby devs.
I hope you can help.

In what directory should it be installed? I think its site/plugins/mzur/kirby-calendar is that correct? When downloading the source (MacOS) i get 'kirby-calendar-plugin-master' but in index.php it says 'mzur/kirby-calendar'

Under Panel, the instruction state: "Take a look at the blueprints directory of this repo to see a full example."
I could not find a blueprints directory in this repo or any examples.
I have tried several things with a structure but I couldn't get it to work. Where should i look for an example of this calendar in a blueprint for the Panel?

It would be nice to have a panel screenshot here. I had the idea of trying to add one if I had installed this, but installing is a problem for me.

Hope you can help, thanks,
René

Calendar returns "There currently are no events."

Hello!

I put the "calendar-table" snippet in my template and I created a new event but the calendar returns "There currently are no events."

This is the snippet:

<?php $calendar = calendar($page->calendar()->yaml()); ?>

<?php
	$tmpDate = getdate(0);
	$currentDate = getdate();
?>

<table class="calendar">

<?php if (!$calendar->getAllEvents()): ?>

	<tr><td><?php echo l::get('calendar-no-entry'); ?></td></tr>

<?php else: ?>

	<thead>
		<tr>
			<th><?php echo l::get('date'); ?></th>
<?php foreach ($fields as $field): ?>
			<th><?php echo $field; ?></th>
<?php endforeach; ?>
		</tr>
	</thead>
	<tbody>
<?php foreach ($calendar->getAllEvents() as $event):
		$date = $event->getBeginDate();
?>
<?php 	if ($tmpDate['mon'] < $date['mon'] || $tmpDate['year'] < $date['year']): ?>
		<tr class="month<?php e($date['mon'] < $currentDate['mon'] or $date['year'] < $currentDate['year'], ' past'); ?>">
			<td colspan="<?php echo count($fields)+1; ?>"><?php echo strftime(l::get('calendar-month-format'), $date[0]); ?></td>
		</tr>
<?php 	endif; ?>
		<tr class="event<?php e($event->isPast(), ' past'); ?>">
			<td><?php
				echo $event->getBeginHtml();
				if ($event->hasEnd()) {
					echo ' '.l::get('to').' '.$event->getEndHtml();
				}
			?></td>
<?php 	foreach ($fields as $key => $value): ?>
			<td><?php echo $event->getField($key); ?></td>
<?php 	endforeach; ?>
		</tr>
<?php $tmpDate = $date; ?>
<?php endforeach; ?>
	</tbody>

<?php endif; ?>
</table>

and this is where the snippet is located:

 <section class="events">
        <div class="container">
          <div class="row">
            <div class="col-md-12">
              <div class="big-intro">
                Events
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-md-3">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div>
            <div class="col-md-9">
              <?php snippet('calendar-table') ?>
          </div>
        </div>
      </section>

What did I do wrong? 🤔

Recurring events

Explore how recurring events could be implemented.

Ideas:

  • Calendar getEvents() and getAllEvents() get optional arguments to specify a termination date in the future. All recurring events only return the single events until this date (else there may be infinite events).
  • Events are extended to be recurring events. Maybe make a new class? Events get a new method expand() or some such that returns the list of single events until the termination date.
  • When getEvents() or getAllEvents() is called, the list of events is created by a call to expand() of all (future) events of the calendar. This list is then sorted and returned.

‘Too many keys’ error since Kirby v2.2.2 release

Thanks for your great plugin, I've been using it for a while, but unfortunately since I updated from Kirby v2.1.2 to v2.2.2 I get the following error message:

Fatal error: Uncaught exception 'Exception' with message 'Too many keys: Opening at 2015-02-27. Open: Fri-Sa-Su 14.00-17.00' in
/path/to/site/kirby/toolkit/vendors/yaml/yaml.php:1057 Stack trace: #0
/path/to/site/kirby/toolkit/vendors/yaml/yaml.php(1096): Spyc->checkKeysInValue('Opening at 2015...') #1
/path/to/site/kirby/toolkit/vendors/yaml/yaml.php(588): Spyc->returnKeyValuePair('opening: Openin...') #2
/path/to/site/kirby/toolkit/vendors/yaml/yaml.php(525): Spyc->_parseLine('opening: Openin...') #3
/path/to/site/kirby/toolkit/vendors/yaml/yaml.php(474): Spyc->loadWithSource(Array) #4
/path/to/site/kirby/toolkit/vendors/yaml/yaml.php(152): Spyc->__load('-\n\n\t_begin_date...') #5
/path/to/site/kirby/toolkit/lib/yaml. in /path/to/site/kirby/toolkit/vendors/yaml/yaml.php on line 1057

Apparently something changed in Kirby v2.2.2, that the calendar plugin doesn't like… any help is welcome…

Allways Displaying no events

I setuped like explained in the manual.
It still shows up there are no Events Setuped.

image
I use the Calendar Table snippet

image

"undefined" Date for an event.

Make events with undefined dates possible. Show them at the top or bottom of the calendar. Make it possible to set individual "undefined" text.

It expects day first in YAML no matter the timezone setting

I have my lang option set to en_US, timezone set to America/Phoenix, and it still expects day before month in the YAML in my calendar events. If I switch them, it gets confused.

This is fine for me, but not when I have other people start editing.

Where to place snippets and files

This Kirby calendar seems very interesting.
I have tried to follow the guide, but the calendar does not return date and time.
Only title and description will echo out.
Apart from that, it works great so far.

This is templates/calendar.php:

    <?php $calendar = calendar($page->calendar()->yaml()); ?>

    <?php
        snippet('calendar-table', array(
            'calendar' => $calendar,
            'fields'   => array(
                'summary'       => l::get('title'),
                'description'   => l::get('description'),
                '_begin_date'   => l::get('_begin_date'),
                '_begin_time'   => l::get('_begin_time'),
                '_end_date'     => l::get('_end_date'),
                '_end_time'     => l::get('_end_time')
            )
        ));
    ?>

Can you help me?

iCal output not working.

Hey,
I did everything as described but when I export the ical file are not the events in the file there.

Hide end date (but show time) if same as start date

Most of my events have _begin_time and _end_time.
Some of them last several days, but most of them start and end on the same day.

Right now, getEndStr() always displays the full end date and time.
If _end_date is empty (or equal to _start_date), I would like to print only the end time.

How can I achieve that? Could I just modify getEndStr() or do I have to change the whole event constructor?

Thanks
Klaas

[K4] 4.0 Compatibility

Function strftime() is deprecated
\site\plugins\kirby-calendar-plugin-master\snippets\calendar-table.php:28

Kirby 4.0.0-rc.4
PHP 8.1.23

Multiple events at the same time

Make multiple events at exactly the same time possible. This has to be a workaround to the YAML parsing because the same array keys are overwritten during parsing.

Different sort order of events per calendar include

Hi, first I have to say it's a great plugin!

I include the calendar two times on the same template/page, the first utilising a custom ‘current‘ (and future) events template and the second a ‘past’ events template.

Now I would like to change the order of the ‘past’ events output. I would be nice to be able to pass an option via $options array to change order of events per calendar include.

Is this possible? How? Or can I get do something in the ‘past’ events template to get the same result?

Thanks

Composer support?

Hey, this plugin looks great already. Do you think it would be possible to add support for usage via composer? Thanks for considering this suggestion.

Upper case field names are incompatible with the panel structure field

The Kirby Panel converts all field names to lower case by default, including custom structure field names. Because of this the following fixed field names of the Calendar Plugin are incompatible with the structure field:

  • _beginDate
  • _beginTime
  • _endDate
  • _endTime

The Calendar Plugin was specifically designed to work with the structure field so I decided to change these fixed field names to snake case (actually reverting ea8311a).

Demo?

Hi,
exist a demo of the calendar plugin?

Kind regards,
jan

Kirby-like event field accessors

Additionally provide Kirby-like accessor functions for the event fields. For example $event->get_field('summary') should be the same as $event->summary().

Google cal, Outlook

Hi there, would it be hard to extend this into google cal or outlook at all ?

Lass uns zusammenarbeiten

Lieber Mzur

Ich habe vor längerer Zeit ein ähnliches Plugin geschrieben. Du findest es unter https://github.com/moritzz/Kirby-Calendar. Im Gegensatz(?) zu Dir, habe ich mich damals entschlossen eine bestehende Bibliothek zur Generierung von vCal-Feeds einzusetzen und damit sehr gute Erfahrungen gemacht.

Momentan läge mir vor allem am Herzen, dass das Plugin nicht nur vCal-Feeds darbieten, sondern auch solche von Google und Co. abonnieren, zusammenführen und wieder publizieren kann.

Was denkst Du?

Herzliche Grüsse und bis hoffentlich bald,
Moritz

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.