Jonathan Jernigan
Forum Replies Created
-
Forum: Plugins
In reply to: [Events Calendar Made Simple – Pie Calendar] First day of week is wrongHey there,
The first day of the week is based on the locale setting of the WordPress time zone setting or the locale shortcode parameter.
Since you always need to show the first day of the week as Monday, take a look at the docs article linked below for the little JS snippet that will allow you to set the first day as Sunday.
You can drop that in a Custom HTML block below the calendar, or even in your template if you’re adding the calendar dynamically.
Hope this helps,
-Jonathan
- This reply was modified 1 week, 3 days ago by Jonathan Jernigan.
Hi there,
First of all, thanks for the kind words.
Regarding the bug, I sincerely apologize and have not seen this reported anywhere.Can you share with me where you reported this bug? We track all of these reports internally and I want to check our records.
We will certainly prioritize investigating a fix and pushing it out as soon as we find a fix.
Thanks!
-JonathanHey there,
I consulted CGPT here for help modifying the code and it said that your snippet is close, but required a little tweaking. This suggestion is untested but should work:
// This filter modifies the query to include only events with a valid start date.
add_filter(
"piecal_event_query_args",
function ($args, $atts) {
$args["meta_query"] = [
"relation" => "AND",
[
"key" => "start_date_acf", // Change to your actual date meta key
"value" => "",
"compare" => "!=",
],
];
return $args;
},
10,
2
);
// This filter sets the start date using combined date and time fields for the event.
add_filter("piecal_start_date_meta_key", function ($key) {
global $post; // Access the current post ID
$start_date = get_field('start_date_acf', $post->ID);
$start_time = get_field('start_time_acf', $post->ID);
if ($start_date && $start_time) {
// Combine date and time fields into a format compatible with Pie Calendar
$key = date("Y-m-d\TH:i:s", strtotime("$start_date $start_time"));
}
return $key;
});
// This filter sets the end date using combined date and time fields for the event.
add_filter("piecal_end_date_meta_key", function ($key) {
global $post; // Access the current post ID
$end_date = get_field('end_date_acf', $post->ID);
$end_time = get_field('end_time_acf', $post->ID);
if ($end_date && $end_time) {
// Combine date and time fields into a format compatible with Pie Calendar
$key = date("Y-m-d\TH:i:s", strtotime("$end_date $end_time"));
}
return $key;
});I asked CGPT for a plain text summary of the differences between your snippet and its suggestion:
Here’s a plain-text breakdown of the changes made:- Defining the Event Filter:
- In your original code, the
meta_query
was looking for an empty or non-existent key but didn’t specify which custom field (ACF field) to check. I updated this part to target thestart_date_acf
field specifically so that only events with a valid start date will appear.
- In your original code, the
- Combining Date and Time Fields:
- The original code had separate fields for date and time but didn’t combine them into a single, usable datetime format.
- I updated the code to:
- Retrieve the ACF date and time fields separately.
- Combine them using PHP’s
strtotime
function to create a single datetime value. - Format that datetime into the
Y-m-d\TH:i:s
format, which Pie Calendar expects to work correctly.
- Global
$post
Variable:- The original code didn’t handle the post ID context, so I included
global $post
to make sure we’re pulling data from the correct post. - Using
global $post
allows the function to work with the current post without directly passing a post ID, but as we discussed, it has some potential risks.
- The original code didn’t handle the post ID context, so I included
Hey Gina,
Glad to hear it’s sorted out now!
Let us know if we can do anything else for you.And thanks for being a Pro customer!
-Jonathan
Forum: Plugins
In reply to: [Events Calendar Made Simple – Pie Calendar] CSS SelectorsGreat, thank you!
Hey there,
The underlying calendar is built using FullCalendar.js which does support creating custom views. Because this feature isn’t something that exists natively in Pie Calendar or in FullCalendar, I’d recommend checking their docs about custom views to see if you can create a custom function to modify the behavior as you need.
https://fullcalendar.io/docs/custom-views
Thanks!
Hey @anthonybartoli,
Glad you got this working and thanks for sharing the solution!
Have a great day
Hi there,
As of version 1.2.3 it’s now possible to add your own custom data into the popover. Here’s a doc article on how to do that: https://docs.piecalendar.com/article/50-using-custom-field-data-in-pie-calendar-popover
It’s possible to add custom field data or anything else using that doc article as a general guide.
Hope this helps!
Thanks,
-JonathanHi there,
This is an issue related to our previous release, which we’ll be fixing in a new update soon. In the meantime, you can use just a little bit of CSS to fix the duplicate names:
.fc-col-header-cell-cushion {
font-size: 0px;
}
.fc-col-header-cell-cushion span {
font-size: 0.75rem;
}Thank you!
Awesome! I’m very glad to hear that.
Have a nice day as well!
Forum: Plugins
In reply to: [Events Calendar Made Simple – Pie Calendar] CSS SelectorsHi there,
Can you let me know specifically what you’re unable to find selectors for? We haven’t included every single thing you could possibly target, but instead just covered the common selectors most folks would need.
I’m happy to help you target specific things and then add them to the doc.
Just me know!
Thanks,
-JonathanHi there,
I see a console error on the front-end of your website:
Uncaught ReferenceError: Alpine is not defined
This is breaking the calendar and rendering no events as a result. More than likely, it’s due to a caching or performance plugin moving or minifying Pie Calendar’s code. Please disable any caching or performance plugins on that page and test again.
Hiding the view dropdown while keeping the prev/next arrows is definitely possible. Use the following css:
.piecal-wrapper .piecal-controls__view-chooser {
display: none;
}That should do the trick!
Thanks,
-JonathanForum: Reviews
In reply to: [Events Calendar Made Simple – Pie Calendar] Very usefulHi there,
Thank you so much for the amazing review! I’m really thrilled to hear Pie Calendar works so well for you. That’s exactly why we built it.
Have a great day and let us know if you need anything or have feedback for us.
Thanks again!
-Jonathan
Hi there,
This sounds to me like a potential caching or JS minification issue. Can you please check for browser console errors on the front-end of that page?
If you have any caching, CDNs, or optimization plugins in place, can you please temporarily disable them? Also, if you can share a URL to the page so I can see the issue that will be helpful as well.
Thanks!
Thanks for this report, although the issue you’re describing seems to indicate the time zone of your WP site is not accessible for some reason. It also shouldn’t be possible to add an invalid date unless you’re doing something custom.
Are you using a front-end form or some other custom means of setting the DateTime field, or modifying your WordPress time zone settings in some other way?
If so, be sure to double check the meta fields and their expected values: https://docs.piecalendar.com/article/8-meta-fields
_piecal_start_date expects a DateTime value like this: 2024-07-25T10:00:00
I have this issue noted for consideration in a future release.
Thanks!