Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

scheduled messages: Fix incorrect mapping of 4PM to 16:00 hours.

Tim Abbott9e5c1eff4b93
diff --git a/web/src/scheduled_messages.js b/web/src/scheduled_messages.js
index b8255e36a5c..6ab1a29caec 100644
--- a/web/src/scheduled_messages.js
+++ b/web/src/scheduled_messages.js
@@ -278,7 +278,7 @@ export function get_filtered_send_opts(date) {
if (minutes_into_day < 9 * 60 - MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS / 60) {
// Allow Today at 9:00am only up to minimum scheduled message delay
possible_send_later_today = send_later_today;
- } else if (minutes_into_day < (12 + 2) * 60 - MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS / 60) {
+ } else if (minutes_into_day < (12 + 4) * 60 - MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS / 60) {
// Allow Today at 4:00pm only up to minimum scheduled message delay
possible_send_later_today.today_four_pm = send_later_today.today_four_pm;
} else {
diff --git a/web/tests/scheduled_messages.test.js b/web/tests/scheduled_messages.test.js
index 8b63d21397e..efe26741dec 100644
--- a/web/tests/scheduled_messages.test.js
+++ b/web/tests/scheduled_messages.test.js
@@ -121,8 +121,8 @@ run_test("scheduled_modal_opts", () => {
{hour: "T08:54:00", extras: ["today_nine_am", "today_four_pm"]},
{hour: "T08:57:00", extras: ["today_four_pm"]},
{hour: "T11:00:00", extras: ["today_four_pm"]},
- {hour: "T13:54:00", extras: ["today_four_pm"]},
- {hour: "T13:57:00", extras: []},
+ {hour: "T15:54:00", extras: ["today_four_pm"]},
+ {hour: "T15:57:00", extras: []},
{hour: "T17:00:00", extras: []},
];