Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import { DatePicker } from "@medusajs/ui"
|
|
|
|
export default function DatePickerRangePresetsTime() {
|
|
return (
|
|
<div className="w-[250px]">
|
|
<DatePicker
|
|
placeholder="Pick a date"
|
|
showTimePicker
|
|
mode="range"
|
|
presets={[
|
|
{
|
|
dateRange: {
|
|
to: new Date(),
|
|
from: new Date(),
|
|
},
|
|
label: "Today",
|
|
},
|
|
{
|
|
label: "Past 7 days",
|
|
dateRange: {
|
|
to: new Date(),
|
|
from: new Date(new Date().setDate(new Date().getDate() - 7)),
|
|
},
|
|
},
|
|
{
|
|
label: "Past 30 days",
|
|
dateRange: {
|
|
to: new Date(),
|
|
from: new Date(new Date().setDate(new Date().getDate() - 30)),
|
|
},
|
|
},
|
|
{
|
|
label: "Past 90 days",
|
|
dateRange: {
|
|
to: new Date(),
|
|
from: new Date(new Date().setDate(new Date().getDate() - 90)),
|
|
},
|
|
},
|
|
{
|
|
label: "Past year",
|
|
dateRange: {
|
|
to: new Date(),
|
|
from: new Date(
|
|
new Date().setFullYear(new Date().getFullYear() - 1)
|
|
),
|
|
},
|
|
},
|
|
]}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|