Skip to content

fix(google-sheets): normalise header case and fix monthly COUNTIFS formula #373

Open
sgresh-stripe wants to merge 1 commit intomainfrom
sgresh/formatfix
Open

fix(google-sheets): normalise header case and fix monthly COUNTIFS formula #373
sgresh-stripe wants to merge 1 commit intomainfrom
sgresh/formatfix

Conversation

@sgresh-stripe
Copy link
Copy Markdown

@sgresh-stripe sgresh-stripe commented May 8, 2026

Summary

Fixes PR comments from here: #369

  • Header case normalisation: fieldToDisplay now lowercases each word segment before capitalising the first, preventing mixed-case field names (e.g. API_version) from leaking uppercase into column headers.
  • Monthly count formula: Replaces COUNTIFS with SUMPRODUCT + DATEVALUE(LEFT(...,10)) to correctly parse ISO timestamp strings into Sheets date serials; the previous COUNTIFS approach failed on text-formatted dates.
  • Tests: Adds a fieldToDisplay / displayToField roundtrip test suite covering snake_case, system fields, and case normalisation.

Test plan

  • pnpm test passes (unit tests cover new fieldToDisplay/displayToField cases)
  • Manually verify Google Sheets header row shows correct sentence-case labels for mixed-case source fields
  • Manually verify "New Customers by Month" example section counts correctly in a real spreadsheet

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