This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
OutlookAddin/src
PointStar a1e25af86b fix(json): tolerate EspoCRM's naive datetime format (YYYY-MM-DD HH:mm:ss)
The cases lookup for "אברהם מוסטקי" was still failing after the
Case.number fix, with a new exception:

  JsonException at $.list[0].createdAt
  The JSON value is not in a supported DateTimeOffset format.

EspoCRM serializes datetimes as "2024-01-15 14:30:00" without a timezone
designator, but .NET's built-in DateTimeOffset reader only accepts
strict ISO 8601 with a tz suffix. Adding the FlexibleStringConverter
to CreatedAt is not enough since the target type is DateTimeOffset, not
string.

Solution: a dedicated FlexibleDateTimeOffsetConverter that:
- Accepts ISO 8601 with offset (fast path)
- Accepts "YYYY-MM-DD HH:mm:ss" / "YYYY-MM-DD" / variants, treating
  them as UTC
- Accepts Unix epoch numbers
- Accepts null / empty strings

Registered globally on the JsonOptions used by EspoCrmClient, so every
model that exposes a DateTimeOffset? deserializes correctly without
per-property attributes.

Tests: 39 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 19:05:32 +03:00
..