์บ˜๋ฆฐ๋” ๋ทฐ

DayFlow๋Š” ์„œ๋กœ ๋‹ค๋ฅธ ์‚ฌ์šฉ ์‚ฌ๋ก€์™€ ์š”๊ตฌ์— ๋งž์ถฐ ์ตœ์ ํ™”๋œ ๋‹ค์„ฏ ๊ฐ€์ง€ ๋ทฐ ํƒ€์ž…์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ฝ”๋“œ๋กœ ๋ทฐ๋ฅผ ์ „ํ™˜ํ•  ์ˆ˜๋„ ์žˆ๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ์ง์ ‘ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ๋Š” UI๋ฅผ ์ œ๊ณตํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ทฐ

์ผ(Day) ๋ทฐ

์ผ ๋ทฐ๋Š” ํ•˜๋ฃจ๋ฅผ ์„ธ๋ฐ€ํ•œ ์‹œ๊ฐ„ ์Šฌ๋กฏ์œผ๋กœ ๋ณด์—ฌ ์ฃผ๋ฏ€๋กœ, ํ•˜๋ฃจ ์ผ์ •์„ ๊ด€๋ฆฌํ•˜๊ธฐ์— ์ ํ•ฉํ•ฉ๋‹ˆ๋‹ค.

์„ค์ •

์†์„ฑํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
showAllDaybooleantrue์ข…์ผ ์ด๋ฒคํŠธ ํ–‰์„ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
scrollToCurrentTimebooleantrue์ฒ˜์Œ ๋กœ๋“œํ•  ๋•Œ ํ˜„์žฌ ์‹œ๊ฐ์œผ๋กœ ์Šคํฌ๋กคํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
timeFormat'12h' | '24h''24h'์‹œ๊ฐ„ ์ถ•์— ์‚ฌ์šฉํ•  ์‹œ๊ฐ„ ํ˜•์‹์ž…๋‹ˆ๋‹ค.
secondaryTimeZonestringundefined์ผ ๋ทฐ์—์„œ๋งŒ ํ‘œ์‹œ๋˜๋Š” ๋ณด์กฐ ๊ธฐ์ค€ ํƒ€์ž„๋ผ์ธ์ž…๋‹ˆ๋‹ค.
hourHeightnumber72์‹œ๊ฐ„ ๊ทธ๋ฆฌ๋“œ์—์„œ ๊ฐ ์‹œ๊ฐ„ ํ–‰์˜ ๋†’์ด(ํ”ฝ์…€)์ž…๋‹ˆ๋‹ค.
import {
  useCalendarApp,
  DayFlowCalendar,
  createDayView,
  ViewType,
} from '@dayflow/react';

function MyCalendar() {
  const calendar = useCalendarApp({
    views: [createDayView()],
    defaultView: ViewType.DAY,
    initialDate: new Date(),
  });

  return <DayFlowCalendar calendar={calendar} />;
}
<template>
  <DayFlowCalendar :calendar="calendar" />
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createDayView, ViewType } from '@dayflow/core';

const calendar = useCalendarApp({
  views: [createDayView()],
  defaultView: ViewType.DAY,
  initialDate: new Date(),
});
</script>
import { Component } from '@angular/core';
import { createDayView, ViewType } from '@dayflow/core';
import { DayFlowCalendarModule } from '@dayflow/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <dayflow-calendar [calendar]="calendar"></dayflow-calendar>
  `
})
export class AppComponent {
  calendar = {
    views: [createDayView()],
    defaultView: ViewType.DAY,
    initialDate: new Date(),
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createDayView, ViewType } from '@dayflow/core';

  const calendar = useCalendarApp({
    views: [createDayView()],
    defaultView: ViewType.DAY,
    initialDate: new Date(),
  });
</script>

<DayFlowCalendar {calendar} />

์ฃผ(Week) ๋ทฐ

์ฃผ ๋ทฐ๋Š” ์‹œ๊ฐ„ ์Šฌ๋กฏ์ด ์žˆ๋Š” 7์ผ ๊ทธ๋ฆฌ๋“œ๋ฅผ ๋ณด์—ฌ ์ฃผ๋ฉฐ, ๊ฐ ์ด๋ฒคํŠธ์˜ ์ •ํ™•ํ•œ ์‹œ์ž‘ยท์ข…๋ฃŒ ์‹œ๊ฐ์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

์„ค์ •

์†์„ฑํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
showWeekendsbooleantrueํ† ์š”์ผ๊ณผ ์ผ์š”์ผ์„ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
showAllDaybooleantrue์ข…์ผ ์ด๋ฒคํŠธ ํ–‰์„ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
startOfWeeknumber1ํ•œ ์ฃผ์˜ ์‹œ์ž‘ ์š”์ผ์ž…๋‹ˆ๋‹ค(0 = ์ผ์š”์ผ, 1 = ์›”์š”์ผ ๋“ฑ).
scrollToCurrentTimebooleantrue์ฒ˜์Œ ๋กœ๋“œํ•  ๋•Œ ํ˜„์žฌ ์‹œ๊ฐ์œผ๋กœ ์Šคํฌ๋กคํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
timeFormat'12h' | '24h''24h'์‹œ๊ฐ„ ์ถ•์— ์‚ฌ์šฉํ•  ์‹œ๊ฐ„ ํ˜•์‹์ž…๋‹ˆ๋‹ค.
secondaryTimeZonestringundefined์ฃผ ๋ทฐ์—์„œ๋งŒ ํ‘œ์‹œ๋˜๋Š” ๋ณด์กฐ ๊ธฐ์ค€ ํƒ€์ž„๋ผ์ธ์ž…๋‹ˆ๋‹ค.
gridDateClick'day-view' | 'none' | functionundefined๋‚ ์งœ ์…€์„ ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค.
gridDateDoubleClick'create-event' | 'day-view' | 'none' | function'create-event'๋‚ ์งœ ์…€์„ ๋”๋ธ” ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค. 'create-event'(๊ธฐ๋ณธ๊ฐ’)๋Š” ํด๋ฆญํ•œ ์œ„์น˜(์‹œ๊ฐ)์— 1์‹œ๊ฐ„์งœ๋ฆฌ ์ด๋ฒคํŠธ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
hourHeightnumber72์‹œ๊ฐ„ ๊ทธ๋ฆฌ๋“œ์—์„œ ๊ฐ ์‹œ๊ฐ„ ํ–‰์˜ ๋†’์ด(ํ”ฝ์…€)์ž…๋‹ˆ๋‹ค.
import {
  useCalendarApp,
  DayFlowCalendar,
  createWeekView,
  ViewType,
} from '@dayflow/react';

function MyCalendar() {
  const calendar = useCalendarApp({
    views: [createWeekView()],
    defaultView: ViewType.WEEK,
    initialDate: new Date(),
  });

  return <DayFlowCalendar calendar={calendar} />;
}
<template>
  <DayFlowCalendar :calendar="calendar" />
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createWeekView, ViewType } from '@dayflow/core';

const calendar = useCalendarApp({
  views: [createWeekView()],
  defaultView: ViewType.WEEK,
  initialDate: new Date(),
});
</script>
import { Component } from '@angular/core';
import { createWeekView, ViewType } from '@dayflow/core';
import { DayFlowCalendarModule } from '@dayflow/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <dayflow-calendar [calendar]="calendar"></dayflow-calendar>
  `
})
export class AppComponent {
  calendar = {
    views: [createWeekView()],
    defaultView: ViewType.WEEK,
    initialDate: new Date(),
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createWeekView, ViewType } from '@dayflow/core';

  const calendar = useCalendarApp({
    views: [createWeekView()],
    defaultView: ViewType.WEEK,
    initialDate: new Date(),
  });
</script>

<DayFlowCalendar {calendar} />

์›”(Month) ๋ทฐ

์›” ๋ทฐ๋Š” ํ•œ ๋‹ฌ์˜ ๋ชจ๋“  ๋‚ ์งœ๋ฅผ ๋ณด์—ฌ ์ฃผ๋Š” ์ „ํ†ต์ ์ธ ์บ˜๋ฆฐ๋” ๊ทธ๋ฆฌ๋“œ์ž…๋‹ˆ๋‹ค.

์„ค์ •

์†์„ฑํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
showWeekNumbersbooleanfalse์ฃผ ๋ฒˆํ˜ธ๋ฅผ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
showMonthIndicatorbooleantrue์Šคํฌ๋กคํ•  ๋•Œ ์›” ํ‘œ์‹œ ์ œ๋ชฉ์„ ๋ณด์—ฌ ์ค„์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
startOfWeeknumber1ํ•œ ์ฃผ์˜ ์‹œ์ž‘ ์š”์ผ์ž…๋‹ˆ๋‹ค(0 = ์ผ์š”์ผ, 1 = ์›”์š”์ผ ๋“ฑ).
snapToMonthbooleanfalseํ™œ์„ฑํ™”ํ•˜๋ฉด ์Šคํฌ๋กค์„ ๋ฉˆ์ท„์„ ๋•Œ ๊ฐ€์žฅ ๋งŽ์ด ๋ณด์ด๋Š” ๋‹ฌ์˜ ์‹œ์ž‘์œผ๋กœ ๋งž์ถฐ์ง‘๋‹ˆ๋‹ค.
gridDateClick'week-view' | 'day-view' | 'none' | functionundefined๋‚ ์งœ ์…€์„ ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค.
gridDateDoubleClick'create-event' | 'week-view' | 'day-view' | 'none' | function'create-event'๋‚ ์งœ ์…€์„ ๋”๋ธ” ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค. 'create-event'(๊ธฐ๋ณธ๊ฐ’)๋Š” ํด๋ฆญํ•œ ๋‚ ์งœ์— 9:00~10:00 ์ด๋ฒคํŠธ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
eventHeightnumber16์›” ๊ทธ๋ฆฌ๋“œ์—์„œ ๊ฐ ์ด๋ฒคํŠธ ํ–‰์˜ ๋†’์ด(ํ”ฝ์…€)์ž…๋‹ˆ๋‹ค.
scrollMonthScrollConfigโ€”์Šคํฌ๋กค ์ž ๊ธˆ๊ณผ ์›” ์ „ํ™˜ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

MonthScrollConfig

์†์„ฑํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
disabledbooleanfalse์—ฐ์† ์Šคํฌ๋กค์„ ๋น„ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค. ์ด์ „ / ๋‹ค์Œ ๋‚ด๋น„๊ฒŒ์ด์…˜ ๋ฒ„ํŠผ์œผ๋กœ๋งŒ ๋‹ฌ์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
transition'fade' | undefinedundefined๋‹ฌ์„ ์ „ํ™˜ํ•  ๋•Œ์˜ ์• ๋‹ˆ๋ฉ”์ด์…˜์ž…๋‹ˆ๋‹ค(disabled: true์ผ ๋•Œ๋งŒ ์ ์šฉ). 'fade'๋Š” ํ˜„์žฌ ๋‹ฌ์„ ๊ฐ€๋กœ๋กœ ๋ฐ€๋ฉด์„œ ์„œ์„œํžˆ ์‚ฌ๋ผ์ง€๊ฒŒ ํ•˜๊ณ  ๋‹ค์Œ ๋‹ฌ์„ ์„œ์„œํžˆ ๋‚˜ํƒ€๋‚˜๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค. ์ƒ๋žตํ•˜๋ฉด ๊ธฐ์กด์˜ ๋ถ€๋“œ๋Ÿฌ์šด ์Šคํฌ๋กค ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์œ ์ง€๋ฉ๋‹ˆ๋‹ค.
createMonthView({
  scroll: {
    disabled: true, // lock to one month at a time, Prev/Next only
    transition: 'fade', // optional fade animation (omit to keep smooth scroll)
  },
});
import {
  useCalendarApp,
  DayFlowCalendar,
  createMonthView,
  ViewType,
} from '@dayflow/react';

function MyCalendar() {
  const calendar = useCalendarApp({
    views: [createMonthView()],
    defaultView: ViewType.MONTH,
    initialDate: new Date(),
  });

  return <DayFlowCalendar calendar={calendar} />;
}
<template>
  <DayFlowCalendar :calendar="calendar" />
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createMonthView, ViewType } from '@dayflow/core';

const calendar = useCalendarApp({
  views: [createMonthView()],
  defaultView: ViewType.MONTH,
  initialDate: new Date(),
});
</script>
import { Component } from '@angular/core';
import { createMonthView, ViewType } from '@dayflow/core';
import { DayFlowCalendarModule } from '@dayflow/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <dayflow-calendar [calendar]="calendar"></dayflow-calendar>
  `
})
export class AppComponent {
  calendar = {
    views: [createMonthView()],
    defaultView: ViewType.MONTH,
    initialDate: new Date(),
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createMonthView, ViewType } from '@dayflow/core';

  const calendar = useCalendarApp({
    views: [createMonthView()],
    defaultView: ViewType.MONTH,
    initialDate: new Date(),
  });
</script>

<DayFlowCalendar {calendar} />

์•„์  ๋‹ค(Agenda) ๋ทฐ

์•„์  ๋‹ค ๋ทฐ๋Š” ์ด๋ฒคํŠธ๋ฅผ ๋‚ ์งœ๋ณ„๋กœ ๋ฌถ์–ด ์‹œ๊ฐ„์ˆœ ๋ชฉ๋ก์œผ๋กœ ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค. ๋ชจ๋ฐ”์ผ ๋ ˆ์ด์•„์›ƒ, ์žฅ๊ธฐ ๊ณ„ํš, ๊ทธ๋ฆฌ๊ณ  ๋‹ค๊ฐ€์˜ฌ ์ผ์ •์„ ๋น ๋ฅด๊ฒŒ ํ›‘์–ด๋ณด๋Š” ํ”ผ๋“œ ํ˜•ํƒœ์— ํŠนํžˆ ์ž˜ ๋งž์Šต๋‹ˆ๋‹ค.

์„ค์ •

์†์„ฑํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
daysToShownumber14์•„์  ๋‹ค ๋ชฉ๋ก์— ํ‘œ์‹œํ•  ์—ฐ์† ๋‚ ์งœ ์ˆ˜์ž…๋‹ˆ๋‹ค.
showEmptyDaysbooleantrue์ด๋ฒคํŠธ๊ฐ€ ์—†๋Š” ๋‚ ์งœ๋„ ๋ชฉ๋ก์— ๊ณ„์† ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
timeFormat'12h' | '24h''24h'์‹œ๊ฐ„์ด ์ง€์ •๋œ ์ด๋ฒคํŠธ ํ–‰์— ์‚ฌ์šฉํ•  ์‹œ๊ฐ„ ํ˜•์‹์ž…๋‹ˆ๋‹ค.
gridDateClick'day-view' | 'none' | functionundefined๋‚ ์งœ ๊ตฌํš์„ ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค.
gridDateDoubleClick'day-view' | 'none' | function'day-view'๋‚ ์งœ ๊ตฌํš์„ ๋”๋ธ” ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค.
import {
  useCalendarApp,
  DayFlowCalendar,
  createAgendaView,
  ViewType,
} from '@dayflow/react';

function MyCalendar() {
  const calendar = useCalendarApp({
    views: [
      createAgendaView({
        daysToShow: 14,
        timeFormat: '12h',
        gridDateDoubleClick: 'day-view',
      }),
    ],
    defaultView: ViewType.AGENDA,
    initialDate: new Date(),
  });

  return <DayFlowCalendar calendar={calendar} />;
}
<template>
  <DayFlowCalendar :calendar="calendar" />
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createAgendaView, ViewType } from '@dayflow/core';

const calendar = useCalendarApp({
  views: [
    createAgendaView({
      daysToShow: 14,
      timeFormat: '12h',
      gridDateDoubleClick: 'day-view',
    }),
  ],
  defaultView: ViewType.AGENDA,
  initialDate: new Date(),
});
</script>
import { Component } from '@angular/core';
import { createAgendaView, ViewType } from '@dayflow/core';
import { DayFlowCalendarModule } from '@dayflow/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <dayflow-calendar [calendar]="calendar"></dayflow-calendar>
  `
})
export class AppComponent {
  calendar = {
    views: [
      createAgendaView({
        daysToShow: 14,
        timeFormat: '12h',
        gridDateDoubleClick: 'day-view',
      }),
    ],
    defaultView: ViewType.AGENDA,
    initialDate: new Date(),
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createAgendaView, ViewType } from '@dayflow/core';

  const calendar = useCalendarApp({
    views: [
      createAgendaView({
        daysToShow: 14,
        timeFormat: '12h',
        gridDateDoubleClick: 'day-view',
      }),
    ],
    defaultView: ViewType.AGENDA,
    initialDate: new Date(),
  });
</script>

<DayFlowCalendar {calendar} />

์—ฐ๊ฐ„(Year) ๋ทฐ

์—ฐ๊ฐ„ ๋ทฐ๋Š” ํ•œ ํ•ด ์ „์ฒด๋ฅผ ํ•œ๋ˆˆ์— ๋ณด์—ฌ ์ค๋‹ˆ๋‹ค. DayFlow์˜ ์—ฐ๊ฐ„ ๋ทฐ๋Š” year-canvas(์—ฐ์† ๊ทธ๋ฆฌ๋“œ), fixed-week(52์ฃผ ๊ณ ์ • ์—ด), grid(ํžˆํŠธ๋งต์— ์ ํ•ฉํ•œ 4ร—3 ์›” ๊ทธ๋ฆฌ๋“œ) ์„ธ ๊ฐ€์ง€ ๋ชจ๋“œ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

์„ค์ •

์†์„ฑํƒ€์ž…๊ธฐ๋ณธ๊ฐ’์„ค๋ช…
mode'year-canvas' | 'fixed-week' | 'grid''year-canvas'์—ฐ๊ฐ„ ๋ทฐ์˜ ํ‘œ์‹œ ๋ชจ๋“œ์ž…๋‹ˆ๋‹ค.
startOfWeeknumber1ํ•œ ์ฃผ์˜ ์‹œ์ž‘ ์š”์ผ์ž…๋‹ˆ๋‹ค(0 = ์ผ์š”์ผ, 1 = ์›”์š”์ผ ๋“ฑ). fixed-week์™€ grid ๋ชจ๋“œ์—์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.
showTimedEventsInYearViewbooleanfalse์—ฐ๊ฐ„ ๋ทฐ์— ์‹œ๊ฐ„์ด ์ง€์ •๋œ ์ด๋ฒคํŠธ๋ฅผ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค(์ , ํ‘œ์‹œ์ž, ๋†๋„).
gridDateClick'popup' | 'day-view' | 'none' | function'popup'(grid ๋ชจ๋“œ) ๋‚ ์งœ ์…€์„ ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค.
gridDateDoubleClick'create-event' | 'day-view' | 'none' | function'create-event'(grid ๋ชจ๋“œ) ๋‚ ์งœ ์…€์„ ๋”๋ธ” ํด๋ฆญํ–ˆ์„ ๋•Œ์˜ ๋™์ž‘์ž…๋‹ˆ๋‹ค. 'create-event'(๊ธฐ๋ณธ๊ฐ’)๋Š” 9:00~10:00 ์ด๋ฒคํŠธ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
gridHeatmapLevelsnumber5(grid ๋ชจ๋“œ) ํžˆํŠธ๋งต ๋†๋„ ๋‹จ๊ณ„ ์ˆ˜์ž…๋‹ˆ๋‹ค.

ํžˆํŠธ๋งต ์ปค์Šคํ„ฐ๋งˆ์ด์ง• (grid ๋ชจ๋“œ)

mode: 'grid'์„ ์‚ฌ์šฉํ•˜๋ฉด ์บ˜๋ฆฐ๋”๊ฐ€ ํžˆํŠธ๋งต์ฒ˜๋Ÿผ ๋™์ž‘ํ•˜์—ฌ, ๊ฐ ๋‚ ์งœ์˜ ๋†๋„(์ƒ‰์ƒ)๊ฐ€ ์ด๋ฒคํŠธ ์ˆ˜์— ๋”ฐ๋ผ ๊ฒฐ์ •๋ฉ๋‹ˆ๋‹ค. ์ „์—ญ CSS์—์„œ ๋‹ค์Œ CSS ๋ณ€์ˆ˜๋ฅผ ์žฌ์ •์˜ํ•ด ์ƒ‰์ƒ์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

/* Light Mode Heatmap */
.df-year-grid-month {
  --heat-1: #ebf5ff;
  --heat-2: #cfe8ff;
  --heat-3: #91d5ff;
  --heat-4: #60a5fa;
  --heat-5: #3b82f6;
}

/* Dark Mode Heatmap */
.dark .df-year-grid-month {
  --heat-1: #1e3a5f;
  --heat-2: #2563eb;
  --heat-3: #1e40af;
  --heat-4: #3b82f6;
  --heat-5: #93c5fd;
}

gridHeatmapLevels๋ฅผ ๋‹ค๋ฅธ ๊ฐ’(์˜ˆ: 3)์œผ๋กœ ๋ฐ”๊พผ๋‹ค๋ฉด, ๊ทธ ์ˆ˜์— ๋งž์ถฐ ๋ณ€์ˆ˜๋„ ํ•จ๊ป˜ ์ •์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค(์˜ˆ: --heat-1๋ถ€ํ„ฐ --heat-3๊นŒ์ง€).

import {
  useCalendarApp,
  DayFlowCalendar,
  createYearView,
  ViewType,
} from '@dayflow/react';

function MyCalendar() {
  const calendar = useCalendarApp({
    views: [
      createYearView({
        mode: 'grid',
        showTimedEventsInYearView: true,
        gridHeatmapLevels: 5,
      }),
    ],
    defaultView: ViewType.YEAR,
  });

  return <DayFlowCalendar calendar={calendar} />;
}
<template>
  <DayFlowCalendar :calendar="calendar" />
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import { createYearView, ViewType } from '@dayflow/core';

const calendar = useCalendarApp({
  views: [
    createYearView({
      mode: 'grid',
      showTimedEventsInYearView: true,
      gridHeatmapLevels: 5,
    }),
  ],
  defaultView: ViewType.YEAR,
});
</script>
import { Component } from '@angular/core';
import { createYearView, ViewType } from '@dayflow/core';
import { DayFlowCalendarModule } from '@dayflow/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <dayflow-calendar [calendar]="calendar"></dayflow-calendar>
  `
})
export class AppComponent {
  calendar = {
    views: [
      createYearView({
        mode: 'grid',
        showTimedEventsInYearView: true,
        gridHeatmapLevels: 5,
      }),
    ],
    defaultView: ViewType.YEAR,
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import { createYearView, ViewType } from '@dayflow/core';

  const calendar = useCalendarApp({
    views: [
      createYearView({
        mode: 'grid',
        showTimedEventsInYearView: true,
        gridHeatmapLevels: 5,
      }),
    ],
    defaultView: ViewType.YEAR,
  });
</script>

<DayFlowCalendar {calendar} />

์—ฌ๋Ÿฌ ๋ทฐ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๊ธฐ

์—ฌ๋Ÿฌ ๋ทฐ๋ฅผ ๋“ฑ๋กํ•ด ์‚ฌ์šฉ์ž๊ฐ€ ์„œ๋กœ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

import {
  useCalendarApp,
  DayFlowCalendar,
  createAgendaView,
  createDayView,
  createWeekView,
  createMonthView,
  createYearView,
  ViewType,
} from '@dayflow/react';

function MultiViewCalendar() {
  const calendar = useCalendarApp({
    views: [
      createAgendaView({ daysToShow: 10 }),
      createDayView(),
      createWeekView(),
      createMonthView(),
      createYearView(),
    ],
    defaultView: ViewType.MONTH,
    initialDate: new Date(),
    callbacks: {
      onViewChange: view => {
        console.log('View changed to:', view);
      },
    },
  });

  return (
    <div className='h-screen'>
      <DayFlowCalendar calendar={calendar} />
    </div>
  );
}
<template>
  <div class="h-screen">
    <DayFlowCalendar :calendar="calendar" />
  </div>
</template>

<script setup>
import { DayFlowCalendar, useCalendarApp } from '@dayflow/vue';
import {
  createAgendaView,
  createDayView,
  createWeekView,
  createMonthView,
  createYearView,
  ViewType,
} from '@dayflow/core';

const calendar = useCalendarApp({
  views: [
    createAgendaView({ daysToShow: 10 }),
    createDayView(),
    createWeekView(),
    createMonthView(),
    createYearView(),
  ],
  defaultView: ViewType.MONTH,
  initialDate: new Date(),
  callbacks: {
    onViewChange: (view) => {
      console.log('View changed to:', view);
    },
  },
});
</script>
import { Component } from '@angular/core';
import {
  createAgendaView,
  createDayView,
  createWeekView,
  createMonthView,
  createYearView,
  ViewType,
} from '@dayflow/core';
import { DayFlowCalendarModule } from '@dayflow/angular';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [DayFlowCalendarModule],
  template: `
    <div class="h-screen">
      <dayflow-calendar [calendar]="calendar"></dayflow-calendar>
    </div>
  `
})
export class AppComponent {
  calendar = {
    views: [
      createAgendaView({ daysToShow: 10 }),
      createDayView(),
      createWeekView(),
      createMonthView(),
      createYearView(),
    ],
    defaultView: ViewType.MONTH,
    initialDate: new Date(),
    callbacks: {
      onViewChange: (view: any) => {
        console.log('View changed to:', view);
      },
    },
  };
}
<script>
  import { DayFlowCalendar, useCalendarApp } from '@dayflow/svelte';
  import {
    createAgendaView,
    createDayView,
    createWeekView,
    createMonthView,
    createYearView,
    ViewType,
  } from '@dayflow/core';

  const calendar = useCalendarApp({
    views: [
      createAgendaView({ daysToShow: 10 }),
      createDayView(),
      createWeekView(),
      createMonthView(),
      createYearView(),
    ],
    defaultView: ViewType.MONTH,
    initialDate: new Date(),
    callbacks: {
      onViewChange: (view) => {
        console.log('View changed to:', view);
      },
    },
  });
</script>

<div class="h-screen">
  <DayFlowCalendar {calendar} />
</div>

์ฝ”๋“œ๋กœ ๋ทฐ ์ œ์–ดํ•˜๊ธฐ

๋ทฐ ์ „ํ™˜

// Change to a specific view
calendar.changeView(ViewType.WEEK);

// Get current view
const currentView = calendar.app.getCurrentView();
console.log(currentView.type); // 'week'

ํƒ์ƒ‰

๋ชจ๋“  ๋ทฐ๊ฐ€ ๋™์ผํ•œ ํƒ์ƒ‰ ๋ฉ”์„œ๋“œ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค:

// Go to today
calendar.goToToday();

// Go to previous period (day/week/month/agenda/year depending on current view)
calendar.goToPrevious();

// Go to next period
calendar.goToNext();

// Go to a specific date
calendar.selectDate(new Date(2024, 9, 15));

ViewType ์—ด๊ฑฐํ˜•

enum ViewType {
  DAY = 'day',
  WEEK = 'week',
  MONTH = 'month',
  AGENDA = 'agenda',
  YEAR = 'year',
}

์ด ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ