You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@requires zhCN 语言 /
import RangeCalendar from 'rc-calendar/lib/RangeCalendar';
import Picker from 'rc-calendar/lib/Picker';
import zhCN from 'rc-calendar/lib/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
export default function WorksCenter() {
/*
I'm trying to use react's hooks, but it doesn't seem to be supported.
value[1].clone is not a function
example:
import React, { useEffect, useState, useRef } from 'react';
import styles from './WorksCenter.css';
/**
/
import RangeCalendar from 'rc-calendar/lib/RangeCalendar';
import Picker from 'rc-calendar/lib/Picker';
import zhCN from 'rc-calendar/lib/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
export default function WorksCenter() {
/*
*/
const now = moment();
now.utcOffset(8);
const [time, setTime] = useState(['', '']);
const [hoverTime, setHoverTime] = useState(['', ''])
const calendar = (
<RangeCalendar
className={
${styles['rc-calendar']}
}style={{zIndex: '100', left: '440px', top: '30px'}}
hoverValue={hoverTime}
onHoverChange={(data) => {setHoverTimeFn(data)}}
showWeekNumber={false}
dateInputPlaceholder={['start', 'end']}
defaultValue={[now, now.clone().add(1, 'months')]}
locale={zhCN}
/>
);
const setHoverTimeFn = (data) => {
setHoverTime(data)
}
return (
);
}
The text was updated successfully, but these errors were encountered: