<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title></title>
        <link>https://interactivetools.com/forum/forum-search.php?k=user%3ADjulia</link>
        <description></description>
        <pubDate>Sun, 03 May 2026 20:39:02 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-search.php?k=user%3ADjulia&amp;rss=1" rel="self" type="application/rss+xml" />

                <item>
          <title>Multi-search with &quot;if&quot; filter on $searchRows</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2248204#post2248204</link>
          <description><![CDATA[<p>Hi Deborah,</p>
<p>Since you're using an "approved" checkbox field, you can simply exclude unapproved listings with:</p>
<pre class="language-php"><code>customWhere: "approved = '1'"</code></pre>
<pre class="language-php"><code>// list of businesses
list($business_directoryRecords, $business_directoryMetaData) = getRecords(array(
  'tableName' =&gt; 'business_directory',
  'loadCreatedBy' =&gt; false,
));

// SEARCH BY WORD/PHRASE //
// for type-in search box
$searchOptions = array();
$searchOptions['keywords'] = @$_REQUEST['q'];
$searchOptions['perPage']  = "200";
$searchOptions['debugSql'] = "0"; // set to '1' to use debug

$searchTables = array();

$searchTables['business_directory'] = array(
  'viewerUrl'    =&gt; '/business/directory/directory-search-results.php',
  'titleField'   =&gt; 'business_name',
  'summaryField' =&gt; 'description',
  'field1'       =&gt; 'num',
  'field2'       =&gt; 'contact_names',
  'field3'       =&gt; 'phone_1',
  'field4'       =&gt; 'phone_2',
  'field5'       =&gt; 'address',
  'field6'       =&gt; 'town_city',
  'field7'       =&gt; 'business_website_url',
  'field8'       =&gt; 'alternate_website_url',
  'field9'       =&gt; 'alternate_website_url_title',
  'field10'      =&gt; 'approved',

  'searchFields' =&gt; array(
    'business_name',
    'description',
    'contact_names'
  ),

  // ONLY show approved listings
  'customWhere'  =&gt; "approved = '1'",
);

list($searchRows, $searchDetails) = searchMultipleTables($searchTables, $searchOptions);
</code></pre>
<p>This ensures that only listings with the <strong>approved checkbox checked</strong> are included in your multi-search results.</p>
<p>I hope this helps!</p>
<p>Djulia</p>]]></description>
          <pubDate>Mon, 01 Dec 2025 22:39:14 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2248204#post2248204</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247820#post2247820</link>
          <description><![CDATA[<p>Hi MercerDesign,</p>
<p>The issue appears to stem from improper handling of dates that span across two years in the week view, particularly during the transition from week 52/53 of one year to week 1 of the following year. This can lead to inconsistencies in the values generated for $week_start, $start, and $end.</p>
<p>Here is a corrected version for the query in the week view:</p>
<pre class="language-php"><code>// Creates a date for the start of the given week (ISO year and ISO week)
$date = new DateTime();
$date-&gt;setISODate($year, $week); // Sets the date using the ISO year and week

// Format for the start and end of the week
$week_start = $date-&gt;format($FORMAT_START); // First day of the week
$start = $date-&gt;modify('-1 week')-&gt;format($FORMAT_START); // Start of the previous week
$end = $date-&gt;modify('+2 weeks -1 day')-&gt;format($FORMAT_END); // End of the following week

// SQL query to find events overlapping this period
$query = "start_date &lt;= '$end' AND end_date &gt;= '$start'";
</code></pre>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Fri, 20 Dec 2024 05:30:35 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247820#post2247820</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247808#post2247808</link>
          <description><![CDATA[<p>Hi Jeff,</p>
<p>Thanks for the suggestion! Supporting RRule is a great idea for handling complex recurring events like "the 3rd Wednesday of every month for 12 months."</p>
<p>To integrate support for the RRule standard, we can use the PHP Recurr library.</p>
<p>Step 1: Add Recurr to the project via Composer</p>
<pre class="language-php"><code>composer require simshaun/recurr</code></pre>
<p>Step 2: Pre-processing events</p>
<pre class="language-php"><code>use Recurr\Rule;
use Recurr\Transformer\ArrayTransformer;

/**
 * Expands events based on their RRule (recurrence rule).
 *
 * This function processes an array of events, checks if each event has an RRule, 
 * and generates the corresponding occurrences based on the RRule. If an event 
 * does not have an RRule, it is added to the result as is. For events with 
 * valid recurrence rules, the function will expand them into multiple occurrences
 * and return the list of expanded events.
 *
 * @param array $events The array of events, where each event can have an optional 'rrule' key.
 * @return array The array of expanded events with start and end dates adjusted for each occurrence.
 */
function expandRRuleEvents(array $events): array {
    $expandedEvents = [];
    $transformer = new ArrayTransformer();

    foreach ($events as $event) {
        // If the event has no RRule, add it as is
        if (empty($event['rrule'])) {
            $expandedEvents[] = $event;
            continue;
        }

        // Extract original time (hours, minutes, seconds) from the start and end dates
        $originalStartTime = (new DateTime($event['start_date']))-&gt;format('H:i:s');
        $originalEndTime = (new DateTime($event['end_date']))-&gt;format('H:i:s');

        // Ensure the event has a valid recurrence rule
        try {
            $rule = new Rule($event['rrule'], new DateTime($event['start_date']));
            $occurrences = $transformer-&gt;transform($rule);

            foreach ($occurrences as $occurrence) {
                $newEvent = $event;

                // Adjust start and end dates by applying the original time
                $newEvent['start_date'] = $occurrence-&gt;getStart()-&gt;format('Y-m-d') . ' ' . $originalStartTime;
                $newEvent['end_date'] = $occurrence-&gt;getEnd()-&gt;format('Y-m-d') . ' ' . $originalEndTime;

                unset($newEvent['rrule']); // Remove the RRule key to avoid unnecessary duplicates

                $expandedEvents[] = $newEvent;
            }
        } catch (Exception $e) {
            // If the rule is invalid, log the error and skip the event
            error_log("RRule processing error: " . $e-&gt;getMessage());
        }
    }

    return $expandedEvents;
}
</code></pre>
<p>Before calling renderMonthCalendar, we can apply pre-processing to the events.</p>
<pre class="language-php"><code>// Displays the monthly view with events for the month
$expandedEvents = expandRRuleEvents($events);
renderMonthCalendar($month, $year, $expandedEvents, $weekStart, $lang, $translations);</code></pre>
<p>Here’s an example of an event with an RRule:</p>
<pre class="language-php"><code>$events = [
    [
        'title' =&gt; 'Team Meeting',
        'start_date' =&gt; '2024-01-17 10:00:00',
        'end_date' =&gt; '2024-01-17 11:00:00',
        'description' =&gt; 'Monthly team sync-up',
        'location' =&gt; 'Conference Room',
        'rrule' =&gt; 'FREQ=MONTHLY;BYDAY=3WE;COUNT=12',           // RRule for the 3rd Wednesday of each month.
        //'rrule' =&gt; 'FREQ=WEEKLY;BYDAY=MO,WE,FR;COUNT=12',     // Repeat the event every Monday, Wednesday, and Friday for 12 occurrences.
        //'rrule' =&gt; 'FREQ=YEARLY;BYDAY=1MO;BYMONTH=1;COUNT=5', // Repeat the event on the first Monday of January, every year, for 5 years.
        //'rrule' =&gt; 'FREQ=WEEKLY;BYDAY=MO,WE,FR;COUNT=10',     // Repeat the event every Monday, Wednesday, and Friday for 10 occurrences.
    ],
];</code></pre>
<p>With this integration, the calendar becomes compatible with complex rules defined by RRule while retaining the flexibility to handle simple or one-time events.</p>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Wed, 18 Dec 2024 07:03:31 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247808#post2247808</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247802#post2247802</link>
          <description><![CDATA[<p>Hi MercerDesign,</p>
<p>Can you try with this version? Thanks!</p>
<p>Djulia</p>]]></description>
          <pubDate>Mon, 16 Dec 2024 03:57:40 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247802#post2247802</guid>
        </item>
                <item>
          <title>Sorting a multi list</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247793#post2247793</link>
          <description><![CDATA[<p>Hi ,</p>
<p><span class="HwtZe"><span class="jCAhz ChMk0b"><span class="ryNqvb">Have you tried with orderBy?</span></span></span></p>
<pre class="language-php"><code>// load records from 'timeline'
list($timelineRecords, $timelineMetaData) = getRecords(array(
  'tableName'   =&gt; 'timeline',
  'loadUploads' =&gt; true,
  'orderBy'     =&gt; 'start_year DESC', // or ASC
  'allowSearch' =&gt; false,
));</code></pre>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Thu, 12 Dec 2024 00:53:57 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247793#post2247793</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247761#post2247761</link>
          <description><![CDATA[<p>Thanks! You could perhaps add a <em>vertical-align:top</em> to the cell to align the events. It's just a suggestion.</p>
<pre class="language-css"><code>.calendar-week th, .calendar-week td {
	width: 80px;
	border: 1px solid #ccc;
	padding: 10px;
	text-align: left;
	word-wrap: break-word;
	vertical-align: top;
}</code></pre>]]></description>
          <pubDate>Tue, 26 Nov 2024 00:24:19 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247761#post2247761</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247756#post2247756</link>
          <description><![CDATA[<p>Hi MercerDesign,<br /><br />Can you try with this version? Thanks!<br /><br />Djulia</p>]]></description>
          <pubDate>Mon, 25 Nov 2024 07:57:46 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247756#post2247756</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247752#post2247752</link>
          <description><![CDATA[<p>Hi MercerDesign,</p>
<p>You can use user-agent analysis in the getCalendarParams() function :</p>
<pre class="language-php"><code>/**
 * Retrieves and validates calendar parameters from the GET request.
 * Defaults to the current month, year, week, and day if parameters are not set.
 */
function getCalendarParams() {
    // Define default parameters
    $defaults = [
        'view'  =&gt; 'month',
        'year'  =&gt; date('Y'),
        'month' =&gt; date('m'),
        'week'  =&gt; date('W'),
        'day'   =&gt; date('d')
    ];

    // Retrieve GET parameter values, using default values if not set
    $view  = isset($_GET['view']) ? $_GET['view'] : null;
    $year  = isset($_GET['year']) ? intval($_GET['year']) : $defaults['year'];
    $month = isset($_GET['month']) ? intval($_GET['month']) : $defaults['month'];
    $week  = isset($_GET['week']) ? intval($_GET['week']) : $defaults['week'];
    $day   = isset($_GET['day']) ? intval($_GET['day']) : $defaults['day'];

    // List of allowed views
    $allowed_views = ['month', 'week', 'day', 'year'];

    // Device detection
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    if (is_null($view)) { // Only if the view is not specified in $_GET
        if (preg_match('/Mobile|Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i', $user_agent)) {
            $view = 'day'; // Default view for mobile
        } else {
            $view = 'week'; // Default view for desktop
        }
    }

    // Validate parameters
    $view = in_array($view, $allowed_views) ? $view : $defaults['view'];
    $year = ($year &gt;= 1970 &amp;&amp; $year &lt;= date('Y') + 25) ? $year : $defaults['year'];
    $month = ($month &gt;= 1 &amp;&amp; $month &lt;= 12) ? $month : $defaults['month'];
    $week = ($week &gt;= 1 &amp;&amp; $week &lt;= 53) ? $week : $defaults['week'];
    $day = ($day &gt;= 1 &amp;&amp; $day &lt;= 31) ? $day : $defaults['day'];

    // Return validated parameters as an array
    return [
        'view'  =&gt; $view,
        'year'  =&gt; $year,
        'month' =&gt; $month,
        'week'  =&gt; $week,
        'day'   =&gt; $day
    ];
}</code></pre>
<p>However, if you're looking for a more accurate solution, the Mobile Detect library is commonly used to determine whether the user is accessing the site from a mobile device or a desktop.<br /><a href="https://github.com/serbanghita/Mobile-Detect" rel="nofollow">https://github.com/serbanghita/Mobile-Detect</a></p>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Wed, 20 Nov 2024 08:00:08 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247752#post2247752</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247745#post2247745</link>
          <description><![CDATA[<p>Sorry for the delay, I had to finish a task. Could you please try this version? Thanks!</p>]]></description>
          <pubDate>Wed, 13 Nov 2024 10:05:47 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247745#post2247745</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247743#post2247743</link>
          <description><![CDATA[<p>Thank you, I can reproduce the issue. In the meantime, could you use this file? Thanks!</p>]]></description>
          <pubDate>Wed, 13 Nov 2024 04:13:37 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247743#post2247743</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247741#post2247741</link>
          <description><![CDATA[<p>Can you provide the event in this format or with showme()? Thanks!<br /><br /></p>
<pre class="language-php"><code>[
  'title' =&gt; 'Annual Conference',
  'start_date' =&gt; '2024-11-13 13:00:00',
  'end_date' =&gt; '2024-11-13 13:10:00',
  'permalink' =&gt; 'annual-conference',
  'description' =&gt; 'Annual conference on technological innovations.',
  'location' =&gt; 'Main Auditorium',
  'category' =&gt; 'conference'
],</code></pre>]]></description>
          <pubDate>Wed, 13 Nov 2024 03:56:17 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247741#post2247741</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247739#post2247739</link>
          <description><![CDATA[<p>What do the errors say in the Developer Log?</p>]]></description>
          <pubDate>Wed, 13 Nov 2024 03:44:07 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247739#post2247739</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247737#post2247737</link>
          <description><![CDATA[<p>Oops! In your calendar.php file, you need to place calendar_functions.php after viewer_functions.php.</p>]]></description>
          <pubDate>Wed, 13 Nov 2024 03:31:45 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247737#post2247737</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247735#post2247735</link>
          <description><![CDATA[<p>And what if you switch to production mode?</p>]]></description>
          <pubDate>Wed, 13 Nov 2024 03:24:40 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247735#post2247735</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247733#post2247733</link>
          <description><![CDATA[<p>Hi MercerDesign,</p>
<p>Could you try with these two files in example mode?</p>
<p>I also added an event in the array():</p>
<pre class="language-php"><code>[
  'title' =&gt; 'Annual Conference',
  'start_date' =&gt; '2024-11-13 13:00:00',
  'end_date' =&gt; '2024-11-13 13:10:00',
  'permalink' =&gt; 'annual-conference',
  'description' =&gt; 'Annual conference on technological innovations.',
  'location' =&gt; 'Main Auditorium',
  'category' =&gt; 'conference'
],</code></pre>
<p>Thanks,<br />Djulia</p>

]]></description>
          <pubDate>Wed, 13 Nov 2024 02:27:03 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247733#post2247733</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247669#post2247669</link>
          <description><![CDATA[<p>Could you send me an events file? I can’t seem to reproduce the issue. Thanks!</p>]]></description>
          <pubDate>Tue, 12 Nov 2024 08:09:05 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247669#post2247669</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247667#post2247667</link>
          <description><![CDATA[<p>If you don't want to use the Ajax version, you just need to remove the JavaScript calls:</p>
<pre class="language-markup"><code>&lt;script src="calendar.js" defer&gt;&lt;/script&gt;</code></pre>
<p>If you prefer to keep the current version of your calendar, you can try modifying the renderWeekView() function directly.</p>
<p>In calendar_functions.php, replace:</p>
<pre class="language-php"><code>// Check if the event should be displayed
if (
	($isSameDay &amp;&amp; $currentDate === $eventStart-&gt;format('Y-m-d') &amp;&amp; $hour &gt;= (int)$eventStart-&gt;format('H') &amp;&amp; $hour &lt; (int)$eventEnd-&gt;format('H')) ||
	(!$isSameDay &amp;&amp; (
		($currentDate === $eventStart-&gt;format('Y-m-d') &amp;&amp; $hour &gt;= (int)$eventStart-&gt;format('H')) ||
		($currentDate === $eventEnd-&gt;format('Y-m-d') &amp;&amp; $hour &lt; (int)$eventEnd-&gt;format('H')) ||
		($currentDate &gt; $eventStart-&gt;format('Y-m-d') &amp;&amp; $currentDate &lt; $eventEnd-&gt;format('Y-m-d'))
	))
) {
	renderWeekEvent($event, $eventTimeDisplay, $currentHour, $workingStart, $workingEnd);
}</code></pre>
<p>with:</p>
<pre class="language-php"><code>// Check if the event should be displayed
if (
	// Case 1: Short event on the same day (e.g., 5 minutes)
	($isSameDay &amp;&amp; $currentDate === $eventStart-&gt;format('Y-m-d') &amp;&amp; 
		$currentHour &gt;= $eventStart &amp;&amp; $currentHour &lt;= $eventEnd) ||

	// Case 2: Long event on the same day (e.g., 9:00 AM to 5:00 PM)
	($isSameDay &amp;&amp; $currentDate === $eventStart-&gt;format('Y-m-d') &amp;&amp; (
		$hour &gt;= (int)$eventStart-&gt;format('H') &amp;&amp; $hour &lt;= (int)$eventEnd-&gt;format('H')
	)) ||

	// Case 3: Multi-day event
	(!$isSameDay &amp;&amp; (
		($currentDate === $eventStart-&gt;format('Y-m-d') &amp;&amp; $hour &gt;= (int)$eventStart-&gt;format('H')) || // Start day
		($currentDate === $eventEnd-&gt;format('Y-m-d') &amp;&amp; $hour &lt; (int)$eventEnd-&gt;format('H')) ||      // End day
		($currentDate &gt; $eventStart-&gt;format('Y-m-d') &amp;&amp; $currentDate &lt; $eventEnd-&gt;format('Y-m-d'))   // Intermediate days
	))
) {
	renderWeekEvent($event, $eventTimeDisplay, $currentHour, $workingStart, $workingEnd);
}</code></pre>
<p>It should also work.</p>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Tue, 12 Nov 2024 07:01:19 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247667#post2247667</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247665#post2247665</link>
          <description><![CDATA[<p>Hi MercerDesign,</p>
<p>I updated the renderWeekView function in calendar_functions.php. Could you try testing this new version?</p>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Tue, 12 Nov 2024 03:07:28 -0800</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247665#post2247665</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247633#post2247633</link>
          <description><![CDATA[<p>If you encounter a display issue, adding this code to the header of your calendar script may be the solution:</p>
<pre class="language-php"><code>// Checks if the request is an AJAX request
if (isset($_GET['ajax']) &amp;&amp; $_GET['ajax'] === 'true' || 
	(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &amp;&amp; strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')) {
	// Send only the content of the chosen view
	if ($view === 'month') {
		renderMonthCalendar($month, $year, $events, $weekStart, $lang, $translations);
	} elseif ($view === 'week') {
		renderWeekView($month, $year, $week, $events, $weekStart, $lang, $translations, $workingStartTime, $workingEndTime);
	} elseif ($view === 'day') {
		renderDayViewWithHours($month, $year, $day, $events, $lang, $translations, $workingStartTime, $workingEndTime);
	} elseif ($view === 'year') {
		renderYearCalendar($year, $events, $weekStart, $lang, $translations);
	}
	exit;
}</code></pre>
<p>Next, you can dynamically add the parameter "ajax=true" to the URLs by modifying the JavaScript as follows:</p>
<pre class="language-javascript"><code>$(document).ready(function() {
    // Handling clicks on view change and navigation links
    $(document).on('click', '.view-switcher a, .calendar-navigation a, .day-number', function(event) {
        event.preventDefault();
        
        // Adding the ajax=true parameter to the URL
        let url = $(this).attr('href');
        url += (url.indexOf('?') &gt; -1 ? '&amp;' : '?') + 'ajax=true';
        
        // Load the page part via AJAX
        loadCalendar(url);
    });

    function loadCalendar(url) {
        toggleLoading(true);

        $('#container-calendar').load(`${url} #container-calendar`, function(response, status, xhr) {
            toggleLoading(false);

            if (status === "error") {
                displayError(xhr.status, xhr.statusText);
            } else {
                updateActiveLink(url);
            }
        });
    }

    function toggleLoading(isLoading) {
        $('#loading').toggle(isLoading);
    }

    function displayError(status, statusText) {
        $('#container-calendar').html(`Sorry, an error occurred: ${status} ${statusText}`);
    }

	function updateActiveLink(url) {
		// Remove the active class from all links in .view-switcher
		$('.view-switcher a').removeClass('active');

		// Extract the view parameter from the URL
		const urlParams = new URLSearchParams(url.split('?')[1]);
		const currentView = urlParams.get('view');

		// Add the active class to the link in .view-switcher corresponding to the current view
		if (currentView) {
			$(`.view-switcher a[href*="view=${currentView}"]`).addClass('active');
		}

		// Remove the active class from all links in .calendar-navigation
		$('.calendar-navigation a').removeClass('active');
	}
});

</code></pre>
<p>This approach ensures that traditional navigation will work even if JavaScript is disabled.</p>
<p>Thanks,<br />Djulia</p>]]></description>
          <pubDate>Thu, 31 Oct 2024 06:41:52 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247633#post2247633</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247631#post2247631</link>
          <description><![CDATA[<p>Hi MercerDesign,<br /><br />Could you try this version? It adds Ajax navigation.</p>
<p>Thanks again,<br />Djulia</p>]]></description>
          <pubDate>Thu, 31 Oct 2024 04:33:23 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247631#post2247631</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247629#post2247629</link>
          <description><![CDATA[<p>Thanks! You can remove all the JavaScript (cf.<span>applyTextColor()</span>).</p>]]></description>
          <pubDate>Wed, 30 Oct 2024 04:26:50 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247629#post2247629</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247627#post2247627</link>
          <description><![CDATA[<p>It's an excellent suggestion.</p>
<p>I have made changes to both files. You need to add an additional list field named "category."</p>
<pre class="language-markup"><code>&lt;label for="category"&gt;Category:&lt;/label&gt;
&lt;select id="category" name="category"&gt;
  &lt;option value="meeting"&gt;Meeting&lt;/option&gt;
  &lt;option value="holiday"&gt;Holiday&lt;/option&gt;
  &lt;option value="workshop"&gt;Workshop&lt;/option&gt;
  &lt;option value="conference"&gt;Conference&lt;/option&gt;
&lt;/select&gt;
</code></pre>
<p>The value should correspond to a CSS class.</p>
<pre class="language-css"><code>/* Category Styles */
.event.meeting { background-color: #3498db; color: #fff; }
.event.holiday { background-color: #2ecc71; color: #000; }
.event.workshop { background-color: #e74c3c; color: #fff; }
.event.conference { background-color: #f1c40f; color: #000; }</code></pre>
<p>You can find an example of a rule in the view file.</p>
<p>Please note that you may need to update the CSS, as it has changed significantly since the first file.</p>
<p>Thanks, Djulia</p>]]></description>
          <pubDate>Wed, 30 Oct 2024 03:57:05 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247627#post2247627</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247623#post2247623</link>
          <description><![CDATA[<p>Hi MercerDesign,<br /><br /></p>
<p><span class="HwtZe"><span class="jCAhz ChMk0b"><span class="ryNqvb">I added a link to switch to day view for the corresponding numbers, thinking it would make it easier to use.</span></span></span></p>
<p>Thanks, Djulia</p>]]></description>
          <pubDate>Wed, 30 Oct 2024 00:37:19 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247623#post2247623</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247621#post2247621</link>
          <description><![CDATA[<p>Oops! There’s an error in the function call:</p>
<p>You can try with:</p>
<blockquote>
<p>// Display navigation for the day (buttons to go to the previous or next day)<br />renderDayNavigation($month, $year, $day, $lang, $translations);</p>
<p>// Display the daily view with events, including the hours of the day<br />renderDayViewWithHours($month, $year, $day, $events, $lang, $translations, $workingStartTime, $workingEndTime);</p>
</blockquote>
<p>Thanks,</p>
]]></description>
          <pubDate>Tue, 29 Oct 2024 06:57:49 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247621#post2247621</guid>
        </item>
                <item>
          <title>Event Calendar - weekly view</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2247619#post2247619</link>
          <description><![CDATA[<p>I added a JavaScript function to adjust the text contrast on events. Thanks!</p>]]></description>
          <pubDate>Tue, 29 Oct 2024 05:41:44 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2247619#post2247619</guid>
        </item>
              </channel>
    </rss>
  