Skip to content

refactor: replace convertToUTC boolean with timezone string in formatting functions#21750

Closed
almeidabbm wants to merge 1 commit intomainfrom
04-02-feat_glitch-291-timezone-aware-formatting
Closed

refactor: replace convertToUTC boolean with timezone string in formatting functions#21750
almeidabbm wants to merge 1 commit intomainfrom
04-02-feat_glitch-291-timezone-aware-formatting

Conversation

@almeidabbm
Copy link
Copy Markdown
Contributor

@almeidabbm almeidabbm commented Apr 3, 2026

relates to: https://linear.app/lightdash/issue/GLITCH-291/update-result-formatting-to-use-resolved-project-timezone

Pure signature refactor — no behavior change.

Replaces convertToUTC: boolean with timezone?: string in formatDate, formatTimestamp, formatItemValue, formatRow, formatRows, getFormattedValue, and all callers.

  • true'UTC' (same behavior via moment.utc())
  • falseundefined (same behavior via moment())

This prepares the formatting stack to accept a project timezone string in the next PR.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

almeidabbm commented Apr 3, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

🧪 Test Selection

✅ Tests that will run

Test Description
Preview Environment Deploys a preview environment for testing
Frontend E2E Tests Runs Cypress app tests
Backend API Tests Runs Vitest API tests
CLI Tests Runs CLI integration and dbt version tests

⏭️ Tests skipped (no relevant file changes detected)

Test How to trigger manually
Timezone Tests Add test-timezone to PR description

Tip: Add test-all to your PR description to run all tests.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

Your preview environment pr-21750 has been deployed.

Preview environment endpoints are available at:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

Preview Environment

🌐 URL: https://lightdash-preview-pr-21750.lightdash.okteto.dev

📋 Logs: View in GCP Console

🔧 SSH: ./scripts/okteto-ssh.sh 21750

@almeidabbm almeidabbm force-pushed the 04-01-04-01-feat_timezone-aware-date-trunc branch from 7212e7e to 552ad79 Compare April 6, 2026 10:43
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from b8f0ca8 to d3ec9da Compare April 6, 2026 10:43
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from d3ec9da to b93b3ab Compare April 6, 2026 11:36
@almeidabbm almeidabbm force-pushed the 04-01-04-01-feat_timezone-aware-date-trunc branch from 552ad79 to 978992f Compare April 6, 2026 11:36
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from b93b3ab to d663049 Compare April 6, 2026 13:37
@almeidabbm almeidabbm force-pushed the 04-01-04-01-feat_timezone-aware-date-trunc branch from adf430e to dc697eb Compare April 6, 2026 13:37
@almeidabbm almeidabbm force-pushed the 04-01-04-01-feat_timezone-aware-date-trunc branch from c27f64d to 31b2fac Compare April 6, 2026 16:28
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from d663049 to 6e27d27 Compare April 6, 2026 16:28
@almeidabbm almeidabbm force-pushed the 04-01-04-01-feat_timezone-aware-date-trunc branch from 31b2fac to 92d6f53 Compare April 7, 2026 08:23
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from 6e27d27 to 656826f Compare April 7, 2026 08:23
@almeidabbm almeidabbm force-pushed the 04-01-04-01-feat_timezone-aware-date-trunc branch 3 times, most recently from e4b6be9 to 81b2790 Compare April 7, 2026 15:04
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from 656826f to 38359f0 Compare April 7, 2026 15:28
@almeidabbm almeidabbm changed the base branch from 04-01-04-01-feat_timezone-aware-date-trunc to graphite-base/21750 April 9, 2026 09:33
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from e865f42 to 4db271a Compare April 9, 2026 09:33
@almeidabbm almeidabbm force-pushed the graphite-base/21750 branch from 4fdb60b to 04fe7b4 Compare April 9, 2026 09:33
@almeidabbm almeidabbm force-pushed the graphite-base/21750 branch from 04fe7b4 to 2290c5b Compare April 9, 2026 09:38
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from 4db271a to 02a4d14 Compare April 9, 2026 09:38
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from 02a4d14 to db9eaad Compare April 9, 2026 10:39
@almeidabbm almeidabbm force-pushed the graphite-base/21750 branch from 2290c5b to 4fe44cf Compare April 9, 2026 10:39
@almeidabbm almeidabbm changed the base branch from graphite-base/21750 to 04-09-feat_timezone-aware_date_trunc_for_all_warehouses April 9, 2026 10:40
@almeidabbm almeidabbm force-pushed the 04-09-feat_timezone-aware_date_trunc_for_all_warehouses branch from 4fe44cf to 529df36 Compare April 9, 2026 11:35
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from db9eaad to a6e5181 Compare April 9, 2026 11:35
@almeidabbm almeidabbm changed the base branch from 04-09-feat_timezone-aware_date_trunc_for_all_warehouses to graphite-base/21750 April 9, 2026 11:46
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from a6e5181 to c6c4d0a Compare April 9, 2026 13:38
@almeidabbm almeidabbm force-pushed the graphite-base/21750 branch from 529df36 to 5dc078d Compare April 9, 2026 13:38
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from c6c4d0a to 846b340 Compare April 9, 2026 14:23
@almeidabbm almeidabbm force-pushed the graphite-base/21750 branch from 5dc078d to 097366b Compare April 9, 2026 14:24
@almeidabbm almeidabbm changed the base branch from graphite-base/21750 to 04-09-feat_timezone-aware_date_trunc_for_all_warehouses April 9, 2026 14:24
@almeidabbm almeidabbm force-pushed the 04-02-feat_glitch-291-timezone-aware-formatting branch from 846b340 to 2b41b2c Compare April 9, 2026 14:35
…ting functions

Replace `convertToUTC: boolean` with `timezone?: string` in
formatDate, formatTimestamp, formatItemValue, formatRow, formatRows,
getFormattedValue, and all callers.

When timezone is provided, uses moment.utc(value).tz(timezone).
When undefined (flag off), uses moment(value) — identical to
previous behavior with convertToUTC=false.

Callers that passed `true` now pass 'UTC' (same behavior).
Callers that passed `false` now pass undefined (same behavior).
@almeidabbm
Copy link
Copy Markdown
Contributor Author

Closing this — we're taking a different approach that keeps the existing convertToUTC parameter and adds timezone as an additive optional parameter instead. This reduces the diff significantly and avoids touching existing callers. New PRs incoming.

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