Element: [Feature Request] Support for triggering'onPick'callback in date-picker typed'datetime'

Created on 15 Jul 2019  ·  5Comments  ·  Source: ElemeFE/element

Existing Component

Component Name

date-time-picker

Description

I need to dynamically compute the selectableRange when the selected date changed. 'OnPick' callback is the good place to do this, but it's only supported in 'range' type. Could you please provide 'onPick' callback in the date-picker with other types.

Most helpful comment

I can't find a time or a custom on the time selector. Try computed on Vue or watch to evaluate the selectableRange and the date.

All 5 comments

Translation of this issue:

Existing Component

yes

Component Name

Date-time-picker

Description

I need to dynamically compute the selectable Range when the selected date changed.'OnPick'callback is the good place to do this, but it's only supported in'range' type. Can you please provide'onPick'callback in the date-picker with other types.

Specify the usage scenario, onClick and onClick can also make callbacks after selection

@webvs2 Thanks for replying me.
My use case is:
When select a date, I need to dynamically disable some non-selectable time based on the selected date.
Dynamically setting selectableRange can help me to disable the non-selectable time.
But I can not find a way to handle the event "click" or "pick" on the date-table.
In the document fo Element-ui, there is only a onClick callback option in PickerOptions.shortcuts, but it's not my requirement.
Is there a way to handle click/pick event on date-table(not shortcuts)?

I can't find a time or a custom on the time selector. Try computed on Vue or watch to evaluate the selectableRange and the date.

you can try webvs2's solution or PR welcomed

Was this page helpful?
0 / 5 - 0 ratings