Skip to content

DJ-73: Migrate backend off Joda-Time to java.time + relative frontend timestamps - #210

Open
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/dj73-joda-time-migration-relative-timestamps
Open

DJ-73: Migrate backend off Joda-Time to java.time + relative frontend timestamps#210
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/dj73-joda-time-migration-relative-timestamps

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Pays down the tech debt in DJ-73 in two workstreams merged into one branch:

Backend — joda-time removed entirely. joda-time:2.10.13 dropped from build.gradle; all org.joda.time.DateTime usages replaced with java.time.Instant across the domain (Article, Comment), DTOs (ArticleData, CommentData), query services, GraphQL datafetchers, the MyBatis DateTimeHandler, DateTimeCursor, and tests. The API date contract is preserved byte-for-byte: JacksonCustomizations now serializes Instant with

DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withZone(ZoneOffset.UTC)

which emits exactly the same ISO-8601 output as joda's ISODateTimeFormat.dateTime().withZoneUTC() (millisecond precision + literal Z, e.g. 2026-07-29T20:29:12.000Z) — verified by diffing curl http://localhost:8080/articles against a pre-migration baseline (identical after normalizing reseeded timestamp values). DateTimeCursor still round-trips epoch millis and DateTimeHandler keeps the same UTC-calendar Timestamp storage, so pagination and existing SQLite data behave unchanged.

Frontend — relative timestamps. New frontend/lib/utils/relativeTime.ts using the built-in Intl.RelativeTimeFormat (no new dependencies; "just now" under 45s, otherwise the largest sensible unit). ArticlePreview, ArticleMeta, and Comment now render relative times (e.g. "2 days ago") with the absolute date in a title tooltip.

Before / After (home feed)

Before (static dates) After (relative timestamps)
before after

Verification

  • ./gradlew clean test spotlessCheck: 68 tests pass, spotless clean. jacocoTestCoverageVerification fails at 0.33 vs the 0.80 gate — preexisting on main (0.3315 baseline vs 0.3322 on this branch, i.e. slightly improved).
  • Frontend npm run build passes.
  • grep -ri joda build.gradle src returns nothing.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/b9fa4a7174334d65b2e60d863b4e5843
Requested by: @HJscarr

@HJscarr HJscarr self-assigned this Jul 30, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant