Project

General

Profile

Actions

Feature #14464

open

Add Wt type support to Json::Value for WDate, WTime, WDateTime

Added by Stefan Bn 22 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/10/2026
Due date:
% Done:

0%

Estimated time:

Description

Wt::Dbo provides sql_value_traits specializations that seamlessly map Wt types like WDate, WTime, and WDateTime to database columns. The Wt::Json module would benefit from a similar, symmetric mechanism.

Currently, when storing Wt date/time values in a Json::Object, users must manually convert to and from intermediate representations. This is repetitive, error-prone, and asymmetric with how Dbo already handles these types.

Proposal:
Extend Json::Value (or provide free helper functions in the Wt::Json namespace) to natively accept and produce the following Wt types, serializing them to JSON-compatible primitives under the hood:

  • WDate
  • WTime
  • WDateTime

The wire format remains valid JSON (no custom types), but the C++ API becomes consistent with how Dbo already handles these types.

Benefit:
Working with both Wt::Dbo and Wt::Json is a great combination when persisting structured metadata in Json::Object columns. The API would feel uniform across Wt's data-handling modules.

Thanks!
Stefan

No data to display

Actions

Also available in: Atom PDF