# scheduler-sync-google-calendar

> Scheduler integrates with Google Calendar data for displaying synchronized appointments.

**Framework:** aspnet-core  **Component:** Scheduler  **Variant:** sync-google-calendar

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/aspnet-core/scheduler-sync-google-calendar.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.Schedule
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/scheduler-sync-google-calendar/scheduler.cshtml

```cshtml
@page
@namespace aspnet_core.Scheduler.SyncGoogleCalendar
@model EJ2CoreSampleBrowser.Scheduler.SyncGoogleCalendar.SyncGoogleCalendarModel
@using Syncfusion.EJ2

    <div class="control-section">
        <div class="schedule-wrapper">
            <ejs-schedule id="schedule" width="100%" height="650px" readonly="true" timezone="UTC" selectedDate="@Model.SelectedDate">
                <e-schedule-eventsettings dataSource="@Model.Appointments"></e-schedule-eventsettings>
                <e-schedule-views>
                    <e-schedule-view option="Day"></e-schedule-view>
                    <e-schedule-view option="Week"></e-schedule-view>
                    <e-schedule-view option="WorkWeek"></e-schedule-view>
                    <e-schedule-view option="Month"></e-schedule-view>
                    <e-schedule-view option="Agenda"></e-schedule-view>
                </e-schedule-views>
            </ejs-schedule>
        </div>
    </div>

```

### src/components/scheduler-sync-google-calendar/scheduler.cshtml.cs

```cs
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace EJ2CoreSampleBrowser.Scheduler.SyncGoogleCalendar
{
    public class SyncGoogleCalendarModel : PageModel
    {
        public DateTime SelectedDate { get; set; } = DateTime.Today;
        // A small placeholder list of "all-day" events mirroring the shape
        // of what you'd normally load from the Google Calendar API. Calling
        // the real API requires a network connection and credentials, so we
        // keep this stub self-contained.
        public List<GoogleEvent> Appointments { get; set; }

        public void OnGet()
        {
            Appointments = new List<GoogleEvent>
            {
                new GoogleEvent { Id = 1, Subject = "All-day sample A",  StartTime = DateTime.Today.AddDays(1).Date, EndTime = DateTime.Today.AddDays(1).AddDays(1).Date, IsAllDay = true },
                new GoogleEvent { Id = 2, Subject = "All-day sample B",  StartTime = DateTime.Today.AddDays(3).Date, EndTime = DateTime.Today.AddDays(3).AddDays(1).Date, IsAllDay = true },
            };
        }
    }

    public class GoogleEvent
    {
        public int Id { get; set; }
        public string Subject { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public bool IsAllDay { get; set; }
    }
}

```
