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 require Time Range Picker feature #9582

Closed
imakou opened this issue Mar 8, 2018 · 13 comments
Closed

Feature require Time Range Picker feature #9582

imakou opened this issue Mar 8, 2018 · 13 comments

Comments

@imakou
Copy link

imakou commented Mar 8, 2018

What problem does this feature solve?

Hi,
First of all, the framework is awesome!

But, I am facing a feature which doesn't implement by ANTD

This issue could relate this:
#8584

But the feature is still not implemented yet in 3.x ANTD.

What does the proposed API look like?

const RangePicker = TimePicker.RangePicker
...
<RangePicker />

Just allows users to pick time range rather than date first then time range.

screen shot 2018-03-08 at 4 45 25 pm

@benjycui
Copy link
Contributor

benjycui commented Mar 9, 2018

Just use RangePicker[mode], see: https://ant.design/components/date-picker-cn/#components-date-picker-demo-mode

@imakou
Copy link
Author

imakou commented Mar 9, 2018

@benjycui Hi, thanks for your replying.
But, I cannot quite understand how to use it.
I've changed state as mode:['time','time'] for rangepicker.
It shows some error message

"Warning: Failed prop type: Invalid prop `mode[0]` of value `time` supplied to `RangeCalendar`, expected one of ['date','month','year','decade'].
    in RangeCalendar (created by RangePicker)
    in RangePicker (created by LocaleReceiver)
    in LocaleReceiver (created by PickerWrapper)
    in PickerWrapper (created by ControlledRangePicker)
    in ControlledRangePicker
    in div"

Could you please give me more specific example or demo?

In the demo from your link, I can see that only DatePicker is allowed to set mode:["time"].
On the other hand, RangePicker doesn't be allowed to set mode:["time"].

@imakou
Copy link
Author

imakou commented Mar 12, 2018

any update?

Thanks.

@yesmeck
Copy link
Member

yesmeck commented Mar 13, 2018

Related #8858

@imakou
Copy link
Author

imakou commented Mar 13, 2018

@yesmeck
Thanks. Will the feature be implemented in the feature?
The time ranger pick is awesome in Ant Design, but it cannot be used independently.
It must be called DatePicker then TimePicker. Hopely, there is an independent time ranger picker.
:)

@sahilchopra
Copy link

+1

@rahulborah
Copy link

rahulborah commented Nov 18, 2019

Any updates on TimeRangePicker?

@yoyo837
Copy link
Contributor

yoyo837 commented Nov 18, 2019

In version 3.0, I used two TimePicker combinations to achieve the goal, although this is not a good method, but it is better than nothing.

 <TimePicker
            placeholder="Select"
            hideDisabledOptions
            popupClassName={style.timepickerPopup}
            {...props}
            open={open}
            onOpenChange={this.handleOpenChange}
            value={startValue === undefined ? firstValue : startValue == null ? undefined : startValue}
            defaultOpenValue={min}
            disabledHours={this.disabledStartTimeHours}
            disabledMinutes={this.disabledStartTimeMinutes}
            disabledSeconds={this.disabledStartTimeSeconds}
            onChange={ev => this.onStartChange(formName, ev)}
            addon={() => (
              <Button size="small" type="primary" onClick={this.handleClose}>
                Ok
              </Button>
            )}
          />

@rahulborah
Copy link

rahulborah commented Nov 18, 2019

@yoyo837 Can you provide an example code like in code sandbox?

@yoyo837
Copy link
Contributor

yoyo837 commented Nov 18, 2019

@rahulborah https://codesandbox.io/s/antd-reproduction-template-gl5j0 Just an example, not a complete feature.

@afc163
Copy link
Member

afc163 commented Mar 6, 2020

Already supported in 4.0: https://ant.design/components/time-picker-cn/#components-time-picker-demo-range-picker

@afc163 afc163 closed this as completed Mar 6, 2020
@gouflv

This comment has been minimized.

@yoyo837
Copy link
Contributor

yoyo837 commented Apr 1, 2020

@gouflv It is.

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

No branches or pull requests

10 participants