From 07434cc323a583e0c00e626a799911befa61392b Mon Sep 17 00:00:00 2001 From: MickeyShnaiderman-RecoLabs Date: Sun, 17 May 2026 14:28:52 +0300 Subject: [PATCH] docs: document known behavioral difference in datetime picture strings Co-authored-by: Cursor --- .golangci.yaml | 1 - README.md | 1 + functions/datetime_format.go | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.golangci.yaml b/.golangci.yaml index 093b5334..5f4edd87 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -17,7 +17,6 @@ linters: - exptostd - fatcontext - funlen - - goconst - gocritic - gocyclo - goprintffuncname diff --git a/README.md b/README.md index 025efe37..7bb89150 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,7 @@ gnata targets exact parity with the JSONata reference implementation ([jsonata-j |---|------|-------|------------|-------| | 1 | **Large integer precision** | `"123456789012345678"` (exact) | `"123456789012345680"` (float64 rounding) | Go's `json.Number` preserves full precision; JS loses it beyond 2^53. Compare with relative tolerance ~1e-12. | | 2 | **Null placeholders in auto-mapping** | `["ext1", "ext2"]` | `[null, "ext1", "ext2"]` | jsonata-js inserts `null` for groups with no predicate match. gnata omits them per spec. Strip `null` entries when comparing. | +| 3 | **Datetime formatting in picture strings** | `"October 15, 2025"` | `"Oct 15, 2025"` | picture string modifiers like `[MNn,*-3]` (abbreviated month) are partially supported. gnata may default to the full name for complex modifiers. | ## Regex Engine: RE2 vs JavaScript RegExp diff --git a/functions/datetime_format.go b/functions/datetime_format.go index 1d94a14f..0893c166 100644 --- a/functions/datetime_format.go +++ b/functions/datetime_format.go @@ -375,6 +375,8 @@ func formatIntegerWithGrouping(v int) string { } func formatMonthToken(m time.Month, modifier string) string { + // TODO: Support complex width modifiers like [MNn,*-3]. + // Currently defaults to full name for range or wildcard modifiers. switch { case strings.HasPrefix(modifier, "Nn"): name := monthNames[m-1]