Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Daterange picker in pop up menu #17

Closed
hannonq opened this issue May 14, 2018 · 4 comments
Closed

[Feature request] Daterange picker in pop up menu #17

hannonq opened this issue May 14, 2018 · 4 comments

Comments

@hannonq
Copy link

hannonq commented May 14, 2018

Hi, first of all, nice component!

I was wondering if there is a way to use it as a pop up menu, like the official date picker from Vuetify.

Ideally, the menu will only show up when the user clicks on the input field to change the date.

Thanks!

@praveenpuglia
Copy link
Owner

praveenpuglia commented May 14, 2018

Can you please tell me exactly which demo you are talking about so I can understand the request better?

BTW, I have used it in a menu in one of my apps as below.

<v-menu full-width offset-y :close-on-content-click="false" v-model="dateMenu" bottom>
    <v-btn color="primary" block outline slot="activator">{{startDateDisplay}} &mdash; {{endDateDisplay}}</v-btn>
    <v-card>
        <v-card-text>
            <DateRange @input="onDateRangeChange" :options="dateRangeOptions"></DateRange>
        </v-card-text>
    </v-card>
</v-menu>

startDateDisplay & endDateDisplay are two computed properties which return the dates in a desirable format for the user to see.

startDateDisplay () {
    return format(new Date(this.startDate), 'MMM D, YYYY')
}
endDateDisplay () {
    return format(new Date(this.endDate), 'MMM D, YYYY')
}

@hannonq
Copy link
Author

hannonq commented May 15, 2018

Thanks for the quick reply.

I was referring to this example, but the code snippet you posted above does the trick very easily.

I'm a complete newbie in Vuejs (and fairly new to Javascript), so I didn't manage to put that together myself.

Since I'm happy with the proposed solution, I'll close this issue for now. And I would suggest that you put this nice example also in the usage guide, since this is a very common need (Just realized that issue #18 is exactly this suggestion)

@hannonq hannonq closed this as completed May 15, 2018
@praveenpuglia
Copy link
Owner

@hannonq the latest demo now includes the menu example at the bottom. :)

@hannonq
Copy link
Author

hannonq commented Jun 6, 2018

Awesome :)
Thanks @praveenpuglia !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants