Vuepic / vue3-date-time-picker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
158 stars 13 forks source link

Feature request: Preset ranges picker #86

Closed rizkypujiraharja closed 2 years ago

rizkypujiraharja commented 2 years ago

Is your feature request related to a problem? Please describe. to make it easier for users to choose a range last month, last 7 days, this month and others, it will be easier for users if there is a preset list that can be clicked

Describe the solution you'd like i want to add props to display date range presets, and the props are an array

[
    {
        label: 'Today',
        ranges: [new Date(), new Date()],
    },
    {
        label: 'Yesterday',
        ranges: [subDays(new Date, 1), subDays(new Date, 1)],
    },
    {
        label: 'Last 7 Days',
        ranges: [subDays(new Date, 6), new Date()],
    },
    {
        label: 'Last 30 Days',
        ranges: [subDays(new Date, 29), new Date()],
    },
    {
        label: 'This Month',
        ranges: [startOfMonth(new Date), endOfMonth(new Date())],
    },
    {
        label: 'Last Month',
        ranges: [startOfMonth(subMonths(new Date, 1)), endOfMonth(subMonths(new Date(), 1))],
    },
]

Describe alternatives you've considered makes it easier for users to choose a date

Additional context I've tried to implement it, Screen Shot 2022-01-24 at 16 30 52

Jasenkoo commented 2 years ago

It is planned, however, I will not have the time to add it in the upcoming version, so it will be in the version after that.