组件
日期选择器
日期选择器使用户能够选择单个日期或日期范围,以便过滤特定时间段的数据。
单日期选择器
从“@sproutsocial/racine”中导入{SingleDa爱游戏体育官网首页tePicker}
属性
名字 | 类型 | 默认的 | 描述 | 需要吗? |
---|---|---|---|---|
日期 |
?时刻美元 |
|||
onDateChange |
(date: moment$ moment) =>无效 |
|||
集中 |
布尔 |
|||
onFocusChange |
({聚焦:布尔值})=>无效 |
日期范围选择器
从“@sproutsocial/racine”中导入{DateRan爱游戏体育官网首页gePicker}
{
const START_DATE = "startDate"
const [dates, setDate] = useState({ startDate, endDate });
const [focusedInput, setFocusedInput] = useState(START_DATE);
const handleDatesChange = (nextDates) => {
onDatesChange && onDatesChange(nextDates);
setDate(nextDates);
};
const handleFocusChange = (nextFocusedInput) => {
onFocusChange && onFocusChange(nextFocusedInput);
setFocusedInput(
nextFocusedInput === null ? START_DATE : nextFocusedInput
);
};
return (
)
}" language="jsx" style="position:relative;text-align:left;box-sizing:border-box;padding:0;overflow:hidden;white-space:pre;font-family:monospace;color:#c8cccc">
属性
名字 | 类型 | 默认的 | 描述 | 需要吗? |
---|---|---|---|---|
startDate可以 |
?时刻美元 |
|||
endDate |
?时刻美元 |
|||
onDatesChange |
({startDate: moment$ moment, endDate: moment$ moment}) =>无效 |
|||
focusedInput |
EnumFocusedInput |
|||
onFocusChange |
(EnumFocusedInput) => void |