Repository navigation
Keep the fractional part of the execution timezone offset when defaulting a DateTime's offset - #396
Merged
dehall merged 1 commit intoNov 2, 2026
Conversation
bryantaustin13
marked this pull request as draft
October 26, 2026 20:49
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #396 +/- ##
=======================================
Coverage 89.17% 89.17%
=======================================
Files 60 60
Lines 5080 5080
Branches 1453 1453
=======================================
Hits 4530 4530
Misses 317 317
Partials 233 233 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bryantaustin13
marked this pull request as ready for review
October 26, 2026 20:56
dehall
approved these changes
Nov 2, 2026
dehall
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the pull request, this looks good to me
…ime's offset DateTime.exec filled in a missing timezoneOffset with an Integer literal, and IntegerLiteral's parseInt dropped the fraction: a +05:30 execution offset became +05:00. Use a Decimal literal so offset-less DateTime literals and selectors get the same offset as Now() and ToDateTime(String). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dehall
force-pushed
the
datetime-fractional-default-offset
branch
from
November 2, 2026 16:48
c9f9ae4 to
acf0378
Compare
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #395
When a DateTime literal or the
DateTime(...)selector had no timezone offset,DateTime.execfilled in the execution offset as an Integer literal.IntegerLiteralrunsparseInt, so a+05:30execution offset became+05:00, and-09:30became-09:00.Now()andToDateTime(String)kept the full offset, so for example@2014-01-01T12:05 = ToDateTime('2014-01-01T12:05')returnedfalseat+05:30.CQL 1.5.3, Logical Specification, DateTime:
The
timezoneOffsetoperand is aDecimal.Changes
src/elm/datetime.ts: build the default offset as a Decimal literal (ELM_DECIMAL_TYPE) instead of an Integer literal.test/elm/datetime/datetime-test.ts: two tests that run the existing minute-precisionDateTimeexpression with execution offsets of+5.5and-9.5, and check that the result keeps the full offset.Verification
src/change (expected '5.0' to equal Decimal '5.5') and pass with it.npm run checkpasses: build, test data generation,test:typecheck,test,lintandprettier.npm testgoes from 5450 passing / 99 pending onmaster(e8096c6) to 5452 passing / 99 pending / 0 failing.test-serverevaluating at+05:30, offset-less literals andDateTime(...)results now get+05:30, the same offset asNow()andToDateTime(String). The 23 tests in the reworkedCQLTimeZoneOffsetTest.xml(added tests for timezone offset tests cql-tests#88) all pass at+05:30with this change. Without it, three fail.Submitter:
npm run checkto run tests, lint, and prettier)Reviewer:
Name:
🤖 Generated with Claude Code