ประเภททั่วไป

นามแฝงของประเภทที่ใช้ร่วมกันในแพ็คเกจ Headless

import type {
DatePickerSize,
WeekDay,
CaptionLayout,
TimePrecision,
HourFormat,
TimePeriod,
MinuteStep,
SecondStep,
CalendarMonth,
DateUnit,
} from "react-date-range-picker-headless";

DatePickerSize

ตัวแปรขนาด UI ไลบรารี Headless hooks จะส่งผ่านค่านี้ไปโดยไม่ใช้งาน ส่วน Styled components ใช้สำหรับกำหนดขนาดภาพ

type DatePickerSize = "x-large" | "large" | "medium" | "small";

WeekDay

วันในสัปดาห์ในรูปแบบสตริง ใช้ในตัวเลือก weekStartsOn

type WeekDay = "sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday";

CaptionLayout

โหมดเลย์เอาต์ส่วนหัวของปฏิทิน

type CaptionLayout = "buttons" | "dropdown";
ค่าคำอธิบาย
"buttons"ปุ่มนำทางเดือนก่อนหน้า/ถัดไป (ค่าเริ่มต้น)
"dropdown"ดรอปดาวน์สำหรับเลือกปีและเดือน

TimePrecision

ควบคุมคอลัมน์เวลาที่จะแสดง

type TimePrecision = "hour" | "minute" | "second";
ค่าคอลัมน์ที่แสดง
"hour"ชั่วโมงเท่านั้น
"minute"ชั่วโมง + นาที
"second"ชั่วโมง + นาที + วินาที

HourFormat

การแสดงเวลาแบบ 12 ชั่วโมงหรือ 24 ชั่วโมง

type HourFormat = "12" | "24";

TimePeriod

ตัวบ่งชี้ AM/PM สำหรับรูปแบบ 12 ชั่วโมง

type TimePeriod = "AM" | "PM";

MinuteStep

ค่าการเพิ่มนาทีที่ถูกต้องสำหรับการเลือกนาทีแบบขั้นบันได

type MinuteStep = 1 | 2 | 3 | 5 | 10 | 15 | 20 | 30;

SecondStep

ค่าการเพิ่มวินาทีที่ถูกต้องสำหรับการเลือกวินาทีแบบขั้นบันได

type SecondStep = 1 | 2 | 3 | 5 | 10 | 15 | 20 | 30;

CalendarMonth

ข้อมูลปฏิทินที่สร้างขึ้นสำหรับหนึ่งเดือน

interface CalendarMonth {
month: Date;
days: (Date | null)[];
weeks: (Date | null)[][];
}

| ฟิลด์ | ประเภท