Closed tennisonchan closed 6 years ago
+1 I'm running into this issue as well. Start date is not being highlighted on initial set using manually created moment.range
, however it is when selecting a range from calendar. Only difference I see in the objects going in to the value
attribute and those coming out of the onSelect
callback are they moment objects have a _i
attribute on them when created by the calendar.
Issue is with moment.range
's contains
calculation, which uses timestamps when comparing dates. The date's on the calendar days are all at midnight, so a start date at 00:00:00
will fail the contains
check. I've submitted a PR that fixes this by setting the CalendarDate
's time to 00:01:00
, thus allowing a range starting at midnight that day to contain the day in question.
@tennisonchan / @puzzfuzz Would we be happy closing this issue as the issue lies with moment.range
?
For visibility was your PR merged in @puzzfuzz ?
My PR was not merged in, but I don't think it's necessary anymore - I've got it working using a vanilla version of this control (I may have been using the moment.range
object wrong, though it was a while ago now).
Close away. Thanks!
I'm running into this as well. @puzzfuzz: what did you do to fix it?
@puzzfuzz I'm running into this same thing now. How did you manage to fix it?
@cp @puzzfuzz I encountered that same issue from moment.range
. My approach was to make sure time was set with the same timezone, in my case, I use UTC.
@puzzfuzz please feel free to close this once you solve this issue. Thanks!
I think I solved this by making sure my moment objects were at the start of the day, before constructing the range. #moment.startOf('day')
Closing this ticket off now, the solution is to ensure you are using the start of day/end of day functionality as mentioned above :+1:
The css of the start date is missing when setting the range value as default state.
The value
range
is amoment-range
object.