Commit Graph

26 Commits

Author SHA1 Message Date
Anders Kaseorg 8e49ca163b tests: Unmock user_settings.
We previously auto-mocked this out of expediency, but that made it
impossible to test anything that uses the Zod schemata in the same
module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg 4d74ecccf3 tests: Use override for user_settings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-09 15:34:58 -07:00
Anders Kaseorg ba8b9a445b eslint: Fix unicorn/prefer-node-protocol.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-08 16:54:15 -07:00
evykassirer b387ad24fa timerender: Move util.the into render_date. 2024-09-10 17:20:00 -07:00
Tim Abbott 6b5847dbf7 timerender: Fix should_display_profile_incomplete_alert.
new Date requires timestamps in milliseconds.
2024-07-09 16:42:23 -07:00
Karl Stolley c5027e6bca message_row: Assign inner .date_row span a class. 2024-04-30 12:42:41 -07:00
Anders Kaseorg 8fb1117cef eslint: Fix no-jquery/no-append-html errors that need test changes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-04 10:11:57 -07:00
Shubham Padia afac26e3e9 refactor: Don't use today arg from render_now in timerender tests.
We cannot remove the today argument for render_now since it is being
used in one other place: timerender.update_timestamps .
2024-01-18 08:32:30 -08:00
Shubham Padia a43a898e12 refactor: Remove today arg from absolute_time.
The today argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00
Shubham Padia 3d2110be51 refactor: Remove current_date arg from last_seen_status_from_date.
The current_date argument was only used in tests and now we're using
and now we're using MockDate in tests.
2024-01-18 08:32:30 -08:00
Shubham Padia d5de26ff3b refactor: Remove current_date arg from relative_time_string_from_date.
The current_date argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00
Shubham Padia 3a233d73c1 refactor: Remove today arg from render_date and use MockDate for tests.
Fixes #26774.
We don't need the today argument anymore since every value passed to
it was a new Date() except the tests where we are using MockDate now.
2024-01-18 08:32:30 -08:00
Anders Kaseorg 06c2b89525 timerender: Use an explicit time zone for all rendering.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-28 16:54:00 -08:00
Anders Kaseorg 100f91e1c9 timerender: Remove unnecessary get_user_locale function.
Subscripting an empty array does not throw an exception in JavaScript,
"default" is not a valid locale, and the browser APIs already fall
back on unrecognized locales anyway.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-19 15:21:34 -08:00
evykassirer 34ceafadd5 recent view: Add button to fetch more conversations.
We add a new timerender format for this context, where there's plenty
of space.

Fixes: #18461
2023-10-13 16:14:55 -07:00
Daniil Fadeev 72fa8b568c timerender: Change relative_time_string_from_date signature. 2023-09-14 11:56:53 -07:00
Joelute eb78264162 navbar_alerts: Delay showing "Complete the organization profile" banner.
Currently, we are displaying the "Complete the organization profile"
banner immediately after the organization was created. It's important to
strongly encourage orgs to configure their profile, so we should delay
showing the banner if the profile has not been configured after 15 days.
Thus also allows the users to check out Zulip and see how it works before
configuring the organization settings.

Fixes: #24122.
2023-08-15 10:46:33 -07:00
Tim Abbott 6fe02e933a timerender: Extract new variant of get_full_datetime.
Separating these concepts allows us to provide a much nicer format for
contexts where ultra-specific clarification is not a priority.

This new variant is currently only used in the scheduled messages UI.
2023-04-30 22:39:52 -07:00
Tim Abbott d42ac60d61 scheduled_message: Fix i18n for scheduled time. 2023-04-28 17:25:00 -07:00
Joelute a96cfb58bd timerender: Remove "Active just now" user status.
Currently, we only show the "Active just now" status once a user has gone
offline within the last 2 minutes. This ends up never showing up the
threshhold which the client marks an user as user is longer than 3 minutes.
Thus deemingthe user status as useless. After a discussion on CZO, it was
decided that we should remove this status altogether as the phrasing doesn't
make sense as well.
2023-04-13 14:59:08 -07:00
Joseph Ho 1e98a659c1 timerender: Revert extra changes to time in recent conversations.
In #25012, which was intended to only modify the buddy list, we
accidentally changed the rendering of times for several other code
paths, including recent conversations, that were using the
last_status_from_time function, whose name really suggested it only
was used for the buddy list.

Extract a new function with a better name for the more common relative
time use case.
2023-04-13 14:59:08 -07:00
Joelute be38730d05 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.
2023-04-12 15:39:49 -07:00
Ujjawal Modi 915084fe82
timerender: Reword user activity info from "Last active:" to "Active".
Fixes #22758.
2023-04-07 09:24:15 -07:00
Anders Kaseorg 96e657a954 install-node: Upgrade Node.js from 18.14.1 to 18.15.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-16 12:32:28 -07:00
Daniil Fadeev a0d15f3029 i18n: Localize date and time displays across the app.
Implemented date localization using native Intl object.
Created special function get_localized_date_or_time_for_format
Made necessary string formatting changes in 'timerender.ts'.
Fixed tests and added some localization tests too.

Tested on my local development server, with some random languages.

Fixes #23987.
2023-02-26 17:43:47 -08:00
Anders Kaseorg cea1119423 node_tests: Move to web/tests.
This lets us simplify the long-ish ‘../../static/js’ paths, and will
remove the need for the ‘zrequire’ wrapper.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-23 16:04:17 -08:00