4

Since years, I'm annoyed when trying to scroll in month view. It always jumps to the beginning of the next month. This feels really bad and sometimes makes it hard to visualize and understand how several events are arranged in relation to each other (or to today)... Hard to describe :)

I know, there is a custom 2, 3 or 4 week setting, where you can have a view across a month border. It could be nice, but it still doesn't scroll by a week.

Today I wanted to drag-and-drop multiple events from June 30th to somewhere in July - First I couldn't, because even my 3-week-view happened to have the border at the same spot... I modified the settings to get the 2-week-view and was lucky (50% chance) - there I could see the 2 weeks I wanted on the same screen.

4 Answers 4

4

There is no keyboard or mouse shortcut to advance only a week. But as a workaround, in the custom view (with 2-4 weeks, can be configured in the settings) you could klick a day in that little calendar on the left, and the custom view starts with that week. Then you click the next week and you have nearly what you want.

Now we just need someone who creates some plugin which does it from a shortcut or the mouse wheel.

1
  • Ah, thank you! This had never occurred to me. Now I have it set to 4 weeks which is almost the same as the normal monthly view except I can see all 4 upcoming weeks on the screen even if those span a month boundary! Perfect.
    – dreeves
    Jul 23, 2021 at 20:00
2

It is also possible to use simple keypress sequences to step the custom 2, 3 or 4 week views forward or back 1 week at a time. Pressing w switches to 1-week view, then pressing p or n steps back (previous) or forward (next) 1 week, then pressing x switches back to your configured (2, 3 or 4 week) custom view.

So the keypress sequences wpx and wnx step the 2, 3, or 4-week custom view back and forward 1 week respectively. Note that they don't work if you type them too fast for Google Calendar to keep up (it probably processes the key presses in parallel, so needs time to switch view before and after the p/n key does the step back/forward).

It is also easy to use programs like AutoHotKey to arrange that the Up and/or PgUp keys generate the wpx sequence for you, and likewise the Down and/or PgDn keys generate the wnx key sequence. It's then just a matter of using the 2, 3, or 4-week custom view and pressing Up/Down or PgUp/PgDn to step back and forward 1 week at a time.

1
  • It's debatable how "easy" it is to replace PgUp/PgDn with Google Calendar navigation key sequences in the browser or across your entire suite of desktop apps, when those keys are vital to perform their default roles in other browser apps and across the desktop. For example, what happens when we want to PgUp our Google Sheets?
    – Wil
    May 19, 2022 at 15:51
2

Set your custom display option to 4 weeks in the calendar settings. Then use this TamperMonkey script in order to navigate weekly using PageUp and PageDown

// ==UserScript==
// @name         Navigate by week
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Use PageDown and PageUp
// @author       You
// @match        https://calendar.google.com/calendar/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';


async function prev_week() {
    document.querySelector('li[data-accelerator="W"]').click()
    await new Promise(r => setTimeout(r, 500));
    document.querySelectorAll('span[data-is-tooltip-wrapper] button')[1].click() // Prev
    await new Promise(r => setTimeout(r, 500));
    document.querySelector('li[data-accelerator="X"]').click();
}

async function next_week() {
    document.querySelector('li[data-accelerator="W"]').click();
    await new Promise(r => setTimeout(r, 500));
    document.querySelectorAll('span[data-is-tooltip-wrapper] button')[2].click(); // Next
    await new Promise(r => setTimeout(r, 500));
    document.querySelector('li[data-accelerator="X"]').click();
}


document.addEventListener('keyup', (event) => {

    if (event.code == 'PageUp') {
        prev_week();
    }

    if (event.code == 'PageDown') {
        next_week();
    }

});

})();
1
  • Did you author this script? If most or all of it is based on another script please edit answer to include attribution.
    – Blindspots
    Jun 26 at 17:00
2

The code below is based on @FriedChicken's answer.

I modified it to support PgUp / PgDn and scrolling a single week.

"View" has to be "4 weeks."

// ==UserScript==
// @name         Google calendar navigate by week
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Use PageDown and PageUp
// @author       You
// @match        https://calendar.google.com/calendar/*
// @grant        none
// @require https://code.jquery.com/jquery-3.7.0.min.js
// ==/UserScript==

(function() {
    'use strict';

    function get_parent_row()
    {
        var miniCalendar = $("#drawerMiniMonthNavigator div[role='rowgroup']");
        var selectedSpans = miniCalendar.find("span[aria-selected='true']");
        if(selectedSpans.length == 1)
        {
            var selectedSpan = selectedSpans[0];
            var parentRow = selectedSpan.closest("div[role='row']");
            return parentRow;
        }
        return null;
    }

    async function prev_week() {
        var parentRow = get_parent_row();
        var nextRow = $(parentRow).prev("div[role='row']");
        var nextSpans = nextRow.find("span[data-grid-cell='true']");
        if(nextSpans.length > 0)
        {
            nextSpans[0].click();
        }
    }

    async function next_week() {
        var parentRow = get_parent_row();
        var nextRow = $(parentRow).next("div[role='row']");
        var nextSpans = nextRow.find("span[data-grid-cell='true']");
        if(nextSpans.length > 0)
        {
            nextSpans[0].click();
        }
    }

    document.addEventListener('wheel', ev => {
        if(ev.wheelDeltaY > 0)
        {
            next_week();
            next_week();
            next_week();
        }
        else
        {
            prev_week();
            prev_week();
            prev_week();
        }
    });

    document.addEventListener('keyup', (event) => {

        if (event.code == 'PageUp') {
            prev_week();
        }

        if (event.code == 'PageDown') {
            next_week();
        }
    });
})();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.