Skip to content

Conversation

@Rohit3523
Copy link
Contributor

@Rohit3523 Rohit3523 commented Jan 24, 2026

Proposed changes

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-1761

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Timestamp component now supports both Unix epoch timestamps and ISO date string formats.
  • Tests

    • Expanded timestamp examples to demonstrate both Unix and ISO timestamp variants.

✏️ Tip: You can customize this high-level summary in your review settings.

@Rohit3523 Rohit3523 requested a deployment to approve_e2e_testing January 24, 2026 20:05 — with GitHub Actions Waiting
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

Walkthrough

This PR adds support for parsing ISO format timestamps in the Markdown timestamp component alongside existing Unix timestamp support. The component now conditionally treats numeric values as Unix seconds or parses string values as ISO dates using dayjs. Story examples are expanded to demonstrate both timestamp formats.

Changes

Cohort / File(s) Summary
Story Examples
app/containers/markdown/Markdown.stories.tsx
Expanded Timestamp story examples to show paired unix and ISO format variants for each token type (e.g., "t (unix)" and "t (iso)"), with ISO examples using fixed 2026-01-23T12:16:24.314+00:00 format.
Timestamp Parsing Logic
app/containers/markdown/components/Timestamp.tsx
Modified timestampMs computation to branch on value type: numeric values treated as Unix seconds (multiplied by 1000), non-numeric strings parsed via dayjs for ISO format support.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • diegolmello

Poem

🐰 Time hops in many formats bright,
Unix seconds, ISO light—
Our humble Timestamp now parses each,
Both numeric and string within reach!
⏰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: ISO format support in markdown component' clearly and specifically summarizes the main change of adding ISO format parsing support to the markdown component timestamp feature.
Linked Issues check ✅ Passed The PR successfully implements ISO format parsing support in the Timestamp component (CORE-1761), enabling both Unix and ISO timestamp parsing with corresponding Storybook examples demonstrating both formats.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing ISO format support: Timestamp.tsx adds ISO parsing logic, and Markdown.stories.tsx documents both Unix and ISO format examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch iso-support-markdown-component

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants