Skip to content

SCIX-692 fix: TimeSince component showing epoch dates for invalid input#730

Merged
thostetler merged 1 commit intoadsabs:masterfrom
thostetler:SCIX-692/Time-Since-showing-weird-values-for-some-users
Dec 16, 2025
Merged

SCIX-692 fix: TimeSince component showing epoch dates for invalid input#730
thostetler merged 1 commit intoadsabs:masterfrom
thostetler:SCIX-692/Time-Since-showing-weird-values-for-some-users

Conversation

@thostetler
Copy link
Member

Fixed bug where TimeSince would throw RangeError or display 1970 dates when given invalid/empty date strings.

  • Added null/undefined/empty string validation to prevent epoch date display
  • Improved date parsing to handle both positive and negative timezone offsets
  • Added support for ISO dates without time portions
  • Added tests

Fixed bug where TimeSince would throw RangeError or display 1970 dates when given invalid/empty date strings.

- Added null/undefined/empty string validation to prevent epoch date display
- Improved date parsing to handle both positive and negative timezone offsets
- Added support for ISO dates without time portions
- Improved TypeScript type safety with TimeSinceProps interface
- Added comprehensive test coverage with 16 tests covering edge cases
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.1%. Comparing base (e4f39b5) to head (e0932e6).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #730     +/-   ##
========================================
+ Coverage    70.1%   70.1%   +0.1%     
========================================
  Files         218     218             
  Lines       24126   24124      -2     
  Branches     1287    1294      +7     
========================================
+ Hits        16895   16904      +9     
+ Misses       7196    7185     -11     
  Partials       35      35             
Files with missing lines Coverage Δ
src/components/TimeSince/TimeSince.tsx 100.0% <100.0%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thostetler thostetler merged commit 644a1ea into adsabs:master Dec 16, 2025
4 checks passed
@thostetler thostetler deleted the SCIX-692/Time-Since-showing-weird-values-for-some-users branch December 16, 2025 14:50
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