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

Range in a single day #226

Open
andrewquartey opened this issue Nov 12, 2019 · 1 comment
Open

Range in a single day #226

andrewquartey opened this issue Nov 12, 2019 · 1 comment

Comments

@andrewquartey
Copy link

I find that when I set singleDateRange to true. I am able to select a single day by double clicking. However the start and end date dates are both the same time (00:00) in that day.

Can it be made such that selecting the same day will change the range of the end date to 23:59?
So that the range becomes. start: 00:00 and end:23:59

@yuepywu
Copy link

yuepywu commented Dec 31, 2019

@andrewquartey you may try the following:

value={moment.range(moment().startOf('day'), moment().endOf('day'))}

References:

https://momentjs.com/docs/#/manipulating/start-of/
moment().startOf('day'); // set to 12:00 am today

https://momentjs.com/docs/#/manipulating/end-of/
moment().endOf("year"); // set the moment to 12-31 23:59:59.999 this year

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