time_picker: Set minutes to zero in global time picker.

Usually when a user uses the time picker, they're most likely going to
set the time to the hour rather than the current minute. These changes
will set the minutes to zero whenever we are opening the global time
picker.

Fixes: #23874.
This commit is contained in:
Joelute
2023-04-10 20:32:07 -04:00
committed by Tim Abbott
parent d0fc3f1c2e
commit be38730d05
3 changed files with 8 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ import * as stream_data from "./stream_data";
import * as stream_settings_ui from "./stream_settings_ui";
import * as sub_store from "./sub_store";
import * as subscriber_api from "./subscriber_api";
import {get_timestamp_for_flatpickr} from "./timerender";
import * as transmit from "./transmit";
import * as ui_report from "./ui_report";
import * as upload from "./upload";
@@ -705,7 +706,7 @@ export function initialize() {
flatpickr.show_flatpickr(
$(compose_click_target)[0],
on_timestamp_selection,
new Date(),
get_timestamp_for_flatpickr(),
{
// place the time picker above the icon and center it horizontally
position: "above center",