mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 23:43:43 +00:00
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:
@@ -355,9 +355,10 @@ export function get_timestamp_for_flatpickr(timestring: string): Date {
|
||||
// we use it to initialize the flatpickr instance.
|
||||
timestamp = parseISO(timestring);
|
||||
} finally {
|
||||
// Otherwise, default to showing the current time.
|
||||
// Otherwise, default to showing the current time to the hour.
|
||||
if (!timestamp || !isValid(timestamp)) {
|
||||
timestamp = new Date();
|
||||
timestamp.setMinutes(0, 0);
|
||||
}
|
||||
}
|
||||
return timestamp;
|
||||
|
||||
Reference in New Issue
Block a user