From 591c6b94301ba4a00313f1fc1ef75f52e295cace Mon Sep 17 00:00:00 2001 From: Gimle Larpes Date: Fri, 13 Jun 2025 00:59:33 +0200 Subject: [PATCH] Document functions --- src/app/atoms/time/Time.jsx | 12 ++++++++++++ src/app/components/message/Time.tsx | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/app/atoms/time/Time.jsx b/src/app/atoms/time/Time.jsx index 3684fb36..d7bbe439 100644 --- a/src/app/atoms/time/Time.jsx +++ b/src/app/atoms/time/Time.jsx @@ -4,6 +4,18 @@ import PropTypes from 'prop-types'; import dateFormat from 'dateformat'; import { isInSameDay } from '../../../util/common'; +/** + * Renders a formatted timestamp. + * + * Displays the time in hour:minute format if the message is from today or yesterday, unless `fullTime` is true. + * For older messages, it shows the date and time. + * + * @param {number} timestamp - The timestamp to display. + * @param {boolean} [fullTime=false] - If true, always show the full date and time. + * @param {boolean} hour24Clock - Whether to use 24-hour time format. + * @param {string} dateFormatString - Format string for the date part. + * @returns {JSX.Element} A