[PR #2381] [MERGED] Keep AM/PM suffix on spaced 12-hour world times #5570

Closed
opened 2026-10-22 04:17:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2381
Author: @Romuromylus
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Romuromylus

Base: refactor ← Head: fix/world-tile-meridiem-order


📝 Commits (1)

  • 8fac427 Keep AM/PM suffix on spaced 12-hour world times

📊 Changes

2 files changed (+80 additions, -13 deletions)

View changed files

➕ src/features/runtime/world-state/lib/world-state-display.test.ts (+65 -0)
📝 src/features/runtime/world-state/lib/world-state-display.ts (+15 -13)

📄 Description

Linked issue

Closes #2372

Why this change

getWorldTimeDisplay tried the 24-hour regex before the meridiem regex, so a spaced 12-hour time like 6:00 PM matched the 24-hour pattern on 6:00 (the trailing space acts as a word boundary) and returned an empty suffix, dropping the AM/PM badge on the roleplay World tile. This worked on main, where meridiem is tried first — a regression.

What changed

  • Run the meridiem match before the 24-hour match, matching main's ordering. The refactor-only [:.h] separator and keywordHour fallback are preserved.

Refactor impact

Primary owner: runtime / world-state (src/features/runtime/world-state/lib/world-state-display.ts)

Impact areas reviewed:

  • Pure string -> object helper used by both the roleplay HUD World widget and the tracker World tile; reordering two disjoint regex branches.

Boundary notes:

  • none

Pressure points touched:

  • none

Validation

  • Matching validation command passes locally
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm vitest run src/features/runtime/world-state/lib/world-state-display.test.ts — 9 passed (spaced PM/AM keep suffix, dotted p.m., 12AM->0 / 12PM->12, no-space 6pm, 24h 18:00, 6h30 separator, keyword morning, empty/null).
  • pnpm exec tsc -b — clean.

Feature Discoverability

  • N/A because this PR is a regression bugfix and does not add a new thing users need to find.

Reason:

  • Restores correct AM/PM display.

Docs and release impact

  • No docs changes needed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2381 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/6/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `refactor` ← **Head:** `fix/world-tile-meridiem-order` --- ### 📝 Commits (1) - [`8fac427`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8fac42703102fc85600e8803f3802d9954fe4138) Keep AM/PM suffix on spaced 12-hour world times ### 📊 Changes **2 files changed** (+80 additions, -13 deletions) <details> <summary>View changed files</summary> ➕ `src/features/runtime/world-state/lib/world-state-display.test.ts` (+65 -0) 📝 `src/features/runtime/world-state/lib/world-state-display.ts` (+15 -13) </details> ### 📄 Description ## Linked issue Closes #2372 ## Why this change `getWorldTimeDisplay` tried the 24-hour regex before the meridiem regex, so a spaced 12-hour time like `6:00 PM` matched the 24-hour pattern on `6:00` (the trailing space acts as a word boundary) and returned an empty suffix, dropping the AM/PM badge on the roleplay World tile. This worked on `main`, where meridiem is tried first — a regression. ## What changed - Run the meridiem match before the 24-hour match, matching `main`'s ordering. The refactor-only `[:.h]` separator and `keywordHour` fallback are preserved. ## Refactor impact Primary owner: runtime / world-state (`src/features/runtime/world-state/lib/world-state-display.ts`) Impact areas reviewed: - Pure `string -> object` helper used by both the roleplay HUD World widget and the tracker World tile; reordering two disjoint regex branches. Boundary notes: - none Pressure points touched: - none ## Validation - [ ] Matching validation command passes locally - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm vitest run src/features/runtime/world-state/lib/world-state-display.test.ts` — 9 passed (spaced PM/AM keep suffix, dotted `p.m.`, 12AM->0 / 12PM->12, no-space `6pm`, 24h `18:00`, `6h30` separator, keyword `morning`, empty/null). - `pnpm exec tsc -b` — clean. ## Feature Discoverability - [x] N/A because this PR is a regression bugfix and does not add a new thing users need to find. Reason: - Restores correct AM/PM display. ## Docs and release impact - [x] No docs changes needed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:27 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5570
No description provided.