Month View Calendar (src/Calendar.tsx)

naive-ui · src/calendar/src/Calendar.tsx · typescript · MIT
ui, fw:vue, tag:month-view

Vue month-grid calendar that tracks a selected date and moves between months. Reuse it when a page needs a visual date view with themed styling and custom header or cell slots.

// Source: https://github.com/tusen-ai/naive-ui | License: MIT | Copyright 2021 TuSimple
// Provided via justclaw.it.com; keep this notice with the code.
import type { CSSProperties, PropType, Ref, SlotsType, VNode } from 'vue'
import type { ThemeProps } from '../../_mixins'
import type { ExtractPublicPropTypes, MaybeArray } from '../../_utils'
import type { CalendarTheme, CalendarThemeOverrides } from '../styles'
import type {
  CalendarDefaultSlotProps,
  CalendarHeaderSlotProps,
  DateItem,
  OnPanelChange,
  OnUpdateValue
} from './interface'
import {
  addMonths,
  format,
  getMonth,
  getYear,
  startOfDay,
  startOfMonth
} from 'date-fns'
import { useMergedState } from 'vooks'
import { computed, defineComponent, Fragment, h, ref, toRef } from 'vue'
import { NBaseIcon } from '../../

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key