assistant-todo-mobile/src/pages/ToDoCal/index.jsx

23 lines
626 B
React
Raw Normal View History

2025-01-01 08:16:32 -05:00
import {Calendar} from "antd-mobile";
import dayjs from "dayjs";
const ToDoCal = (props) => {
const defaultSingle = new Date()
const today = dayjs()
return (
<Calendar
selectionMode='single'
renderLabel={date => {
if (dayjs(date).isSame(today, 'day')) return '今天'
if (date.getDay() === 0 || date.getDay() === 6) {
return '周末'
}
}}
defaultValue={defaultSingle}
onChange={val => {
console.log(val)
}}
/>
)
}
export default ToDoCal;