mirror of https://github.com/zulip/zulip.git
scheduled_messages: Disallow dates in the past in the UI.
The server will probably accept them and just send the message immediately, which seems OK, but we probably want to discourage scheduling a message to be sent in the past, since that's unlikely to be intentional and would make it hard to undo.
This commit is contained in:
parent
cef1e3363c
commit
56c5c8902b
|
@ -911,10 +911,12 @@ export function initialize() {
|
|||
}
|
||||
});
|
||||
$send_later_modal.on("click", ".send_later_custom", (e) => {
|
||||
const current_time = new Date();
|
||||
flatpickr.show_flatpickr(
|
||||
$(".send_later_custom")[0],
|
||||
update_scheduled_date_from_modal,
|
||||
new Date(),
|
||||
new Date(current_time.getTime() + 60 * 60 * 1000),
|
||||
{minDate: new Date(current_time.getTime() + 5 * 60 * 1000)},
|
||||
);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
Loading…
Reference in New Issue