unionco / calendarize Goto Github PK
View Code? Open in Web Editor NEWCalendar Field Type for CraftCMS
License: MIT License
Calendar Field Type for CraftCMS
License: MIT License
Hi,
I have a client that runs single day and two day events. But in the example of the two day events, Day One is 10:15 to 18:00, while Day Two is 10:15 to 16:00.
Would it be possible to have day timings to be set based on how many days an event spans?
Also, as you'll notice above, the days start at 10:15, whereas the plugin currently only has 30 minute increments for the times.
Love the plugin other than this. Just replaced some over-complicated matrix fields.
Thanks!
I'm creating a searchable events listing, but I'm not able to get search working.
Here's a minimal example of what I tried to do in Twig, but I end up with an error.
{% set entries = craft.calendarize.upcoming({ section: ['Event'],
search: 'Birthday' }, 'asc|desc') %}
And I ended up with this error:
Caused by: PDOException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'calendarize44a1a8733e.startDate' in 'where clause'
I've got category and date filters working fine, but I haven't been able to get text search working.
How do I accomplish the following:
I have 12 single-day events, all yearly repeating:
Now, to get all entries for the year 2023 and display their exact dates:
{% set entries = craft.calendarize.between('2023-01-01', '2024-01-01', { section: ['events'] }, 'asc') %}
This gets all relevant entries, how to display their dates?
This seems not possible ATM?
Could we have an option for using Monday as the first day of the week instead of Sunday please?
Hi!
After adding the plugin via composer, make a calendarize field and adding this field to a channel section entry, I get the following error after trying to save the entry:
yii\base\ErrorException: Method unionco\calendarize\models\CalendarizeModel::__toString() must not throw an exception, caught TypeError: Return value of unionco\calendarize\models\CalendarizeModel::__toString() must be of the type string, object returned in /Applications/MAMP/htdocs/wortstellwerk/vendor/craftcms/cms/src/helpers/StringHelper.php:0 Stack trace: #0 [internal function]: yii\base\ErrorHandler->handleFatalError() #1 {main}
In Craft 3.1.8, if I revert an entry that uses a Calendarize field to a previous version, all the data in the Calendarize field is lost.
Hi guys,
This is not an issue but a question, before I try to figure all this out myself only to find out it can't be done: Would it be possible to use these recurring dates when using a front-end form for users to submit an event?
Cheers!
If I try to get all my events with the following code
{% set entries = craft.calendarize.between('2020-01-01', '2020-12-31', { section: ['events'] }, 'asc') %}
i only get the occurences without the next occurence on 4.4.
Is it possible to get a list with really all occurences including the first one with one query?
Thanks for your help!
I was wondering if there was a way to paginate upcoming events - i tried the following:
{% set order = 'asc' %}
{% set unique = true %}
{% set events = craft.calendarize.upcoming({ section: ['events'],limit: 3 }, order, unique) %}
{% paginate events as pageInfo, entries %}
{% for entry in entries %}
//do stuff here
{% endfor %}
But i get the error along the lines of Argument 1 passed to craft\helpers\Template::paginateCriteria() must implement interface yii\db\QueryInterface, array given, called in....
Is there a way i can get paginated upcoming events?
I love being able to add recurring for every nth day or nth day of the week! But sometimes the events we have aren't as regular for instance every holiday there is a sale:
Memorial Day (May 30)
July 4th
Labor day (Sept 6)
etc...
Can we change documentation from:
{% set occurrences = event.calendarizeHandle.getOccurrences(limit = 10) %}
Which will give error to:
{% set limit=10 %} {% set occurrences = event.calendarizeHandle.getOccurrences(limit) %}
Took me a while till I went through all of the combinations to get it right, lets make it easier for others.
Is it possible to change the formatting of the dates within{{ entry.dateTime.readable }}
?
Also potentially the formatting of the wording/terminology?
Is there a way to get ongoing events? Ie events that has a start date in the past, and an end date in the future.
Is it possible that we can add our own translations for the plugin (labels like "All Day" for example) ?
e.g. in translations/<language>/calendarize.php
Using the latest version 1.2.3
{{ event.calendarizeHandle.next.format('j F Y') }}
returns 20 march 2019
in English.
Should return the system-translated 20 maart 2019
(if the system language is Dutch).
Use {{ event.calendarizeHandle|date('D. j F Y') }}
I've been playing around with this plugin (which is exactly what i needed, and looks great!). I saved an event, and when i try to view my entry again in the admin, i get the following error:
Unfortunately i can't access the entry to outline all the options i had turned on, but i had added in repeating, an end repeat, date exceptions and time exceptions.
Unsure if related, but typing in a date exception or time exception, gives the day as undefined unless the entry is then saved, at which point the correct day is displayed:
I've tried recreating the error with other entries, and so far i can't (they save fine and i can view them again without issue). I'm not sure if it's some combination of settings i have added, or maybe exception dates being outside the dates the recurring event is running or something like that?
@fvaldes33
It would be nice to have an extra Repeat Type "Yearly" - for like yearly recurring dates.
e.g. : Holidays, Birth Days…
Do you have any advice or guidance on making entries sortable by their calendarize start date in the craft control panel? Is this a potential feature that could be built into the plugin?
I've been working off of brandonkelly's suggestion here:
craftcms/cms#2818 (comment)
Hey, thank you for this plugin! I'm currently working with it to try and show store opening times.
I have some code which is displaying all the start and end times for event occurences. If that data is changed from having a start/end date to "All Day", the start/end times are still saved, and the front end doesn't correctly update.
Change that to the following and save it:
And it still outputs:
// refb
{% set occurrences = store.openingTimes.getOccurrences(10) %} {# limit is optional and defaults to 10 #}
{% set occurrences = store.openingTimes.getOccurrencesBetween('2019-09-01', '2020-10-01', 10) %} {# limit is optional and defaults to 1 #}
{% for occurrence in occurrences %}
<p>Start: {{ occurrence.start|date('d M Y H:i l') }} / End: {{ occurrence.end|date('d M Y H:i') }}</p>
{% endfor %}
There's something weird going on with the Date Exceptions field.I think this is something to do with the difference between American / English dates, but I'm getting "Undefined, {d/m/Y}" when I select a Date Exception on some repeating entries:
For example, selecting Weds the 4th of September gives me this:
Can I access the time and date as separate entities from startDate?
For example if I add {{ event.calendarizeHandle.startDate.format('j M Y H:i:s') }}
I get a time of midnight even if a time has not been selected.
@janmeeus - Opening a new ticket for these other issues
When adding an occurrence (not repeating) with startDate 2018-02-20 (so "in the past"), it still shows in the results when using craft.calendarize.upcoming.
I'm trying to use your standard method for listing upcoming entries like this; {% set entries = craft.calendarize.upcoming({ section: ['events'] }, 'desc') %}
for I'm getting a Twig runtime error:
Calling unknown method: craft\elements\db\CategoryQuery::next()
events is the name of the section I'm attempting to list entries from, just to confirm.
Hi!
Is it possible to sort a ElementQuery in Twig by the calendarizeHandle like so?:
{% set items = craft.entries.relatedTo('events').orderBy('calendarizeHandle.startDate asc').limit(5).all() %}
I want to get the related entries ordered by the startdate of the event.
Hello, I am looping through occurencies like this, successfully retrieving the next occurence in my template as time (eg. 10:00 pm):
{% for occurrence in occurrences %}
{{ occurrence.next.format('h:i a') }}
{% endfor %}
However, now that I want to have the ending time displayed to ("10:00 pm – 11:00 pm"), using {{ occurence.endDate|date('Y-m-d') }}
throws a templating error, same with using the startDate
query:
Getting unknown property: craft\elements\Entry::endDate
What am I doing wrong?
I assume that being inside that for
loop, I should be able to flexible output stardDate
and endDate
as flexible as it works with next
?
I tried to set a recurring event that starts on 04/02/19. The event is supposed to recur on the first Tuesday of each month, however, the plugin reads 04/02/19 as the last Tuesday of the month and 04/09/19 as the first Tuesday of the month. It seems like this is caused by 5 Tuesdays in the same month.
I am attempting to list out events grouped by this week, next week and beyond. I can get this working with a native custom date field like so:
{% set thisWeek = day|date_modify('this Sunday')|date('Y-m-d') %}
{% set nextWeek = day|date_modify('next Monday')|date('Y-m-d') %}
{% set followingWeek = day|date_modify('next Monday +7 days')|date('Y-m-d') %}
{% set eventsThisWeek = craft.entries.section('events').dateFrom(['and', '<= ' ~ thisWeek ]) %}
{% set eventsNextWeek = craft.entries.section('events').dateFrom(['and', '>= ' ~ nextWeek, '<=' ~ followingWeek ]) %}
{% set eventsBeyondNextWeek = craft.entries.section('events').dateFrom(['and', '> ' ~ followingWeek ]) %}
But as I'm now trying to use the lovely Calendarize the above is no good to me so I've tried variations on to use dateTime.startDate
instead:
i.e. {% set eventsThisWeek = craft.entries.section('events').dateFrom(['and', '<= ' ~ thisWeek ]) %}
This gives me errors of:
Impossible to invoke a method ("startDate") on a null variable.
I'm obviously not doing something right or maybe it isn't possible?
Any ideas?
There is a problem when using additional criteria on queries, like limit:
{% set entries = craft.calendarize.upcoming(
{
section: ['events'],
limit: 4
}
) %}
This results in 2 errors:
If more information is needed, don't hesitate to ask!
I've just updated an event which is a repeating (weekly) entry to change/remove some days of the week, but upon saving it's still showing the previously selected days.
Other fields save and update correctly.
Hi! I've got Calendarize working for part of an Events section on a site. The other section is to show all event prior to today, but paginated. I have it partially working with Craft's paginate tag, but it currently returns ALL entries (as expected).
I'm not sure how to tweak the code to get it to:
Any tips?
Throwing this error in the control panel when adding a date exception, THEN saving the entry.
Setting unknown property: craft\behaviors\CustomFieldBehavior::timezones
Removing any date exceptions removes this error and allows us to save the entry.
We are using Calendarize inside a Super Table
Craft Pro 3.4.5
PHP 7.1.16
MySQL 5.5.5
MariaDB 10.1.32
Is it possible to return all events as an Entry Query instead of an Array as I have to use it with a pagination and it's only possible with an Entry Query?
Thanks a lot!
Found a bug within the repeat monthly. It seems like it's using the American date format, m/d/y rather than d/m/y. Selecting a date over the 12th day in a month will cause the 'Every month on the' dropdown to display 'NaNth' and 'undefined undefined'
Selecting the date 12th April 2019, which is a Friday, populates the dropdown to display 'First Wednesday' even though it's the second Friday. It's looking at the 4th December 2019 which is the first Wednesday.
Is there a setting we can add to a config file to change the date formatting?
It would be nice to prevent the possibility of adding an empty Time exception (empty date + empty time).
On add, a new line with this value is shown: undefined,
. Then, this error is shown on save: Call to a member function format() on null
.
And this could caused another cascading issues. For example, after save, I wasn't able to show anymore the current entry section from the CP: An unknown error occurred
(from admin/actions/element-indexes/get-elements
request). Solution was to edit the entry from the DB (clear the timeChanges
column).
Using the latest version 1.2.3
{{ event.calendarizeHandle.next|date('D. j F Y') }}
now returns error
Object of class unionco\calendarize\models\Occurrence could not be converted to string
In previous version, this returned Fr. 15 februari 2019
Use {{ event.calendarizeHandle.next.format('D. j F Y') }}
or {{ event.calendarizeHandle|date('D. j F Y') }}
I created an event, repeating weekly on a monday, starting a week in the future. Saved it, all good. I went back to view the entry in the admin, and got the following error:
Error: Call to a member function setTime() on boolean
From then on i had to delete the entry, as i couldn't access it in the admin. Devmode is on, calendarize version 1.2.16.
Unfortunately i can't recreate it at this stage, but i've included a screenshot of the error in case anything jumps out at you or someone else reports a similar issue.
If you create an event on the last monday of April (27th) and select the option to repeat it monthly, the dropdown says "Last Montag" (our installation is in German). After saving the event the dropdown options changed to "Fourth Monday" and the dates for June and August are not the last Monday (because they have five Mondays).
If you use the 30th of March as starting date (which is a 5th Monday), the dropdown says "Last Monday" after saving and all repeating dates are correct on the last Monday (ether the fourth or fifth).
We have events both with $Xth weekday and last $weekday of the month.
I was wondering if Calendarize is compatible with Feed Me, and if so, how should the data be structured?
First of all, thanks for a great plugin. I love the upcoming query option, but in a few cases, I need to get a list of unique upcoming events, e.g., with only the next upcoming instance of a repeating event---so that each event entry is listed once in the result set. I don't see a "calendarize" way of doing that. Am I missing something obvious or could this be a candidate for a new feature?
@janmeeus - Opening a new ticket for these other issues
When adding a yearly occurrence that lasts several days (e.g. 20-02-2019 to 24-02-2019), I can only display the startDate of the next occurrence ({{ event.calendarizeHandle.next }}), but not the endDate of the next occurrence.
I'm getting this very strange error on pages that don't relate to Calendarize ever since I installed it.
The full error is:
Impossible to access an attribute ("startDate") on a null variable in "__string_template__72438934248b0d954161cc5bb0a7c4887491e74869a6418409c7eb1144d3966b" at line 14.
I receive it when trying to save entries that don't have Calendarize fields; when I do add them, I am able to save the entry without issue. It also occurs when editing a Section itself, despite not having anything to do with Calendarize (I think?)
Hope someone can help with this as it's really bugging me! :)
If I add a Monday date it appears as Sunday, Wednesday becomes Friday...
(System language is GB english)
When installing this plugin with Composer 1, the following deprecation notice is output:
Deprecation Notice: Class
unionco\calendarize\records\CalendarizeRecord
located in./vendor/unionco/calendarize/src/records/CalendarRecord.php
does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0.
Composer 2 was released on October 24, and is now the default version that will be installed, so it’s critical that this gets resolved ASAP, or people will start getting Class not found
errors.
To fix, run the following command:
> git mv src/records/CalendarRecord.php src/records/CalendarizeRecord.php
Then commit your change and tag a new release.
(Note that you must use the git mv
command, as Git tends to not notice case-sensitive file renames otherwise.)
I was just noticing that the wording of the repeat fields is awkward (for English, anyways):
"Repeats every daily" is incorrect.
"Repeats every day" is correct.
Probably better to either:
I think I would go for option 2 since it's also more clear (no need to explain that biweekly is every 2 weeks rather than 2 times per week, for example).
At the moment it is possible to add an entry that repeats every [Daily, Weekly, BiWeekly, Monthly, Yearly]
But on some occasions, it is just necessary to show the options [Daily, Weekly], or anything that the custom config says.
It would be a great feature for example, just add a json file with that config ?
{
"repeatType": [
"daily",
"weekly",
],
... possible more custom options...
}
Thanks
I know upcoming
implies not started yet, but I'd like to be able to show events that span multiple days until they end before they drop off, is there a way to do this?
Getting "Could not save field." without any error message under any inputs when creating/editing existing calendarize-fields after latest plugin update. Can't find anything in the error logs either.
With GraphQL now included in Craft, it would be great if we could retrieve events using this interface. Maybe this would be a good opportunity to create a paid edition of the plugin for the support of pro features.
I imagine this is probably something to do with Craft' 3.2 draft functionality, but if this plugin is enabled and used on an entry, trying to exit the entry will cause this message, even if no changes were made:
Redactor had the same problem and they fixed it in 2.4.0 if that helps track it down:
craftcms/redactor#161
craftcms/redactor@57331e6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.