blob: 174db318b6b9e9bd99059e31404b20f592345f5a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import { DateRangePicker, Provider, defaultTheme } from '@adobe/react-spectrum'
import { useState } from 'react';
import { today, getLocalTimeZone } from '@internationalized/date';
export default function TimePicker() {
const endTimeframe = today(getLocalTimeZone());
const [value, setValue] = useState({
start: endTimeframe.subtract({ days: 7 }),
end: endTimeframe
});
return (
<>
<Provider theme={defaultTheme}>
<DateRangePicker aria-label="timeframe" value={value} onChange={setValue} />
</Provider>
</>
)
}
|