Skip to content

fix(bases): parse date-only strings as local calendar days - #385

Open
luabagg wants to merge 1 commit into
oleeskild:mainfrom
luabagg:fix/bases-date-timezone
Open

fix(bases): parse date-only strings as local calendar days#385
luabagg wants to merge 1 commit into
oleeskild:mainfrom
luabagg:fix/bases-date-timezone

Conversation

@luabagg

@luabagg luabagg commented Jul 16, 2026

Copy link
Copy Markdown

Why

Bases date("YYYY-MM-DD") was parsed as UTC midnight, so in timezones west of UTC (e.g. Brazil) local day/month/year could land on the previous calendar day. Formulas and .format() should treat a bare date as that local calendar day.

Summary

  • Parse bare YYYY-MM-DD inputs in Bases date() as local calendar days instead of UTC midnight
  • Keep full timestamps on the existing new Date(value) path

Test plan

  • TZ=UTC npx vitest run src/helpers/bases-engine/__tests__/exprEval.test.js
  • Verify a Bases formula using date("2024-01-15") shows Jan 15 locally

new Date("YYYY-MM-DD") is UTC midnight, so local getters can land on the previous day west of UTC. Construct local Date(y, m-1, d) for bare date-only inputs.
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