about summary refs log tree commit diff
path: root/src/view/com/util/TimeElapsed.tsx
Commit message (Collapse)AuthorAgeFilesLines
* Localize dates, counts (#5027)Eric Bailey2024-08-291-4/+8
| | | | | | | | | | | | | | | | | | | | | | | * refactor: consistent localized formatting * refactor: localized date time * refactor: localize relative time with strings * chore: fix typo from copy-paste * Clean up useTimeAgo * Remove old ago * Const * Reuse * Prettier --------- Co-authored-by: Mary <git@mary.my.id>
* Force callers of `getTimeAgo` to pass in the value for "now" (#4560)Eric Bailey2024-06-181-2/+4
| | | | | | | * Remove icky hook for now * Force callers of getTimeAgo to pass in the 'now' value * Update usage in Newskie dialog
* Add `useGetTimeAgo` and utils (#4556)Eric Bailey2024-06-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Create a testable version of ago() and re-enable the disabled test (#4364) * Enable the test of ago() * Use test cases This puts the input and the expected values next to each other. * Create dateDiff function This is a copy of ago(), but with the ability to specify the second date instead of using Date.now(). * Let ago() use dateDiff() * Move constants close to usage * Test dateDiff instead of ago This makes it possible to test the dates without being forced to rely on what the current date is. The commented out tests do not yet pass. This is fixed in later commits. * Update dateDiff and enable the remaining tests * Split up tests, use date-fns as helpers * Remove old test * Add long format * Add hook * Migrate to hooks * Delete old code * Or equal to * Update comment --------- Co-authored-by: Jan Aagaard <jan@aagaard.net>
* [Clipclops] Add clop sent time to clipclop (#3772)Samuel Newman2024-04-301-2/+6
| | | | | * add message sent time to message * fix last message in group logic
* Remove useEffect from TimeElapsed (#3741)dan2024-04-281-4/+4
|
* remove precacheThreadPostProfiles (#3729)Hailey2024-04-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove `precacheThreadPostProfiles` * add `displayName` to `PreviewableUserAvatar` * memo * use `precacheProfile` * pass `profile` directly to `PreviewableUserAvatar` * update the `UserAvatar`'s props * remove feed cache * one more spot * rm unused queryClient * Don't call fn unnecessarily * Preload for display name too * try notification item * add to feeditem * and finally, precache for post threads * timestamp * Fix * onBeforePress --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
* Hindi Internationalization (#1914)Ansh2023-11-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | * get basic hindi support to work * get web app language switcher in * Refactor i18n implementation and remove unused code * add missing strings * add dropdowns and modals missing strings * complete all hindi translations * fix merge conflicts * fix legeacy persisted state * fix data in RecommendedFeeds * fix lint
* Shell behaviors update (react-query refactor) (#1915)Paul Frazee2023-11-151-6/+5
| | | | | | | | | | | * Move tick-every-minute into a hook/context * Move soft-reset event out of the shell model * Update soft-reset listener on new search page * Implement session-loaded and session-dropped events * Update analytics and push-notifications to use new session system
* Give explicit names to MobX observer components (#1413)dan2023-09-071-0/+3
| | | | | | | | | * Consider observer(...) as components * Add display names to MobX observers * Temporarily suppress nested components * Suppress new false positives for react/prop-types
* #984 Updating `indexedAt` timestamps (#1024)Eric Bailey2023-07-191-0/+21
* add TimeElapsed util component, integrate into PostThreadItem * integrate into posts * use consistent naming * use mobx and single interval for TimeElapsed