Skip to content

Refactor: replace deprecated datestr/datenum with datetime API#93

Merged
ehennestad merged 2 commits into
devfrom
fix-datetime-codeissues
May 14, 2026
Merged

Refactor: replace deprecated datestr/datenum with datetime API#93
ehennestad merged 2 commits into
devfrom
fix-datetime-codeissues

Conversation

@ehennestad
Copy link
Copy Markdown
Collaborator

Fix code relying on older datenum/datestr functions that are not recommended anymore. Replaced with datetime.

Replace all 11 datestr and 1 datenum call sites in the codebase with
the modern datetime API. Most edits are mechanical: datestr(now, fmt)
becomes char(datetime('now'), fmt) with format strings converted from
the legacy spec to ICU (MM=month, mm=minute, SS->ss, sss->SSS).

In StackMetadata.toStruct/fromStruct the legacy format string
'YYYY_MM_DD_HH_MM_SS_sss' was actually rejected by datestr itself
('Unrecognized minute format'), meaning toStruct only worked when
StartTime was empty. Both sites now use 'yyyy_MM_dd_HH_mm_ss_SSS'
and roundtrip correctly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Test Results

199 tests  ±0   199 ✅ ±0   21s ⏱️ ±0s
 11 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 9d17257. ± Comparison against base commit ed21b1b.

@ehennestad ehennestad merged commit 4b33dba into dev May 14, 2026
@ehennestad ehennestad deleted the fix-datetime-codeissues branch May 14, 2026 09:11
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