This topic is locked

11.1 Calendar - change displayed data

8/4/2025 6:13:58 PM
PHPRunner General questions
H
headingwest author

Hi All,

Working with the excellent new calendar. Any ideas how to change the displayed text for calendar items on the calendar itself?

for example:

if ($values["calendarCategory"] == 1) {
$values["calendarSubject"] = "!! " . $values["calendarSubject"];
}

Thanks.

ChatGPT 8/4/2025

In PHPRunner, when working with the calendar feature, you can customize the displayed text for calendar items by using the Before display event of the calendar. This allows you to alter the values that will be shown in the calendar based on your conditions.

To modify the calendar item text, you can follow these steps:

  1. Open your PHPRunner project and go to the calendar section where you want to make the changes.


  2. Locate the Before display event:

    • Click on the calendar table in the left panel.
    • Go to the Events tab.
    • Find the Before display event for the calendar.


  3. Add your custom code:
    You can use an if condition to change the displayed text based on your criteria. Here’s how to structure your code:

    // Before display event
    if ($values["calendarCategory"] == 1) {
    $values["calendarSubject"] = "!! " . $values["calendarSubject"];
    } elseif ($values["calendarCategory"] == 2) {
    $values["calendarSubject"] = "** " . $values["calendarSubject"];
    }

    In the example above, if the calendarCategory is 1, it prepends "!! " to the calendarSubject. You can add additional conditions for other categories as needed.


  4. Test your changes:
    After adding the code, save your changes and run your project to see the updated calendar. The subjects of the calendar items should now reflect the modifications you've made based on the specified conditions.



By following these steps, you should be able to customize the displayed text for calendar items within PHPRunner effectively. If you have any specific conditions or further questions, feel free to ask!

H
headingwest author 8/4/2025

Unfortunately the solution offered by ChatGPT isn't possible, there's no such event.

W
wpl 8/5/2025

Hello,

what about "ProcessRecord" event of calendar? Works for me.

img alt