メインコンテンツにスキップ

ScheduleQuest

📅 A free and open source web app to make it easy for others to schedule with you

AI Summary

ScheduleQuest

A Google Apps Script library that lets you find free time slots in Google Calendar with just a few lines of code.

Target Users

Intermediate Google Apps Script developers building internal booking systems or scheduling tools.

Problems Solved

Querying the Calendar API’s FreeBusy endpoint and calculating common availability manually is complex and error-prone.

Tags

Main Features

1
One-liner common availability

Grab the free time slots across multiple calendars with a single ScheduleQuest.find() call.

2
Automatic timezone & duration handling

Automatically respects search range, meeting length and timezones when generating suggestions.

3
Pure GAS, zero external deps

Light-weight, copy-paste friendly library that requires no additional infrastructure.

Usage Examples

[Introduction] Get your calendar’s free slots

function quickDemo() {
  // Find 30-minute openings in the next 3 days
  const slots = ScheduleQuest
    .forCalendars(['primary'])   // Calendar to query
    .withinDays(3)              // Search window
    .durationMinutes(30)        // Meeting length
    .find();                    // Returns an array of slots
  Logger.log(slots);
}

Copy-and-paste code to confirm the library works instantly.

[Basic] Find common availability for a team

function teamMeeting() {
  const teamCalendars = [
    'alice@example.com',
    'bob@example.com',
    'carol@example.com'
  ];
  const freeSlots = ScheduleQuest
    .forCalendars(teamCalendars)
    .withinRange(new Date(), new Date(Date.now() + 1000*60*60*24*7)) // next week
    .durationMinutes(60)  // 1-hour meeting
    .find();
  // Propose the first slot
  CalendarApp.createEvent('Weekly Sync', freeSlots[0].start, freeSlots[0].end);
}

Pass an array of calendar IDs and a date range; ScheduleQuest returns the shared free time.

[Best Practice] Auto-reply booking options from Google Form

function onFormSubmit(e) {
  const requester = e.response.getRespondentEmail();
  const {name, duration} = parseForm(e);

  const free = ScheduleQuest
    .forCalendars(['primary'])
    .withinDays(14)
    .durationMinutes(duration)
    .find()
    .slice(0, 5); // top 5 suggestions

  MailApp.sendEmail({
    to: requester,
    subject: `Booking options: ${name}`,
    body: free.map(t => `${t.start}${t.end}`).join('
')
  });
}

A production-style workflow that ties Google Forms submissions to automatic slot discovery and email responses.