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.

timerender: Fix expiration date on invite modal.

Daniil Fadeev43669a83d8d9
diff --git a/web/src/invite.js b/web/src/invite.js
index ca14129686a..dbb765b9dd1 100644
--- a/web/src/invite.js
+++ b/web/src/invite.js
@@ -17,9 +17,9 @@ import {$t, $t_html} from "./i18n";
import {page_params} from "./page_params";
import * as settings_config from "./settings_config";
import * as stream_data from "./stream_data";
+import * as timerender from "./timerender";
import * as ui from "./ui";
import * as ui_report from "./ui_report";
-import {user_settings} from "./user_settings";
import * as util from "./util";
let custom_expiration_time_input = 10;
@@ -190,18 +190,10 @@ function valid_to(expires_in) {
return $t({defaultMessage: "Never expires"});
}
const valid_to = add(new Date(), {minutes: time_valid});
- const options = {
- year: "numeric",
- month: "numeric",
- day: "numeric",
- hour: "2-digit",
- minute: "2-digit",
- hour12: !user_settings.twenty_four_hour_time,
- };
- return $t(
- {defaultMessage: "Expires on {date}"},
- {date: valid_to.toLocaleTimeString([], options)},
- );
+ const date = timerender.get_localized_date_or_time_for_format(valid_to, "dayofyear_year");
+ const time = timerender.get_localized_date_or_time_for_format(valid_to, "time");
+
+ return $t({defaultMessage: "Expires on {date} at {time}"}, {date, time});
}
function get_expiration_time_in_minutes() {