Dates, Date-Times & Date-Time-Offsets
A date represents a day of the calendar outside of any timezone. A date-time-offset represents an exact point in the time scale, expressed with its offset from Universal Coordinated Time (UTC). A plain (or floating) date-time represents a wall-clock date and time outside of any timezone: it occurs at the same displayed local time, wherever you are. Dates and date-times are formatted according to the ISO 8601 and RFC 3339 standards, whose ABNF grammar is the following:The
Z character in the time-offset part of the string is equivalent to a +00:00 timezone offset. In other words, it indicates the date-time is UTC.string schema identified by its format:
date-time-local is registered in the OpenAPI Format Registry, but it is not defined by the JSON Schema specification, so generic validators ignore it. The corresponding schemas therefore also declare a pattern that rejects any trailing offset.Most date typed properties are suffixed with “On”, and most date-time typed properties (plain or with offset) with “At”. For example:
(date-time) createdAt, (date) occursOn, etc…Date Ranges
- a date-range
2023-01-01--2023-01-31represents the interval between two dates, outside of any timezone. Here, both the start and end date are included. - a date-time-local-range
2023-01-01T00:00:00--2023-01-02T00:00:00represents the interval between two plain date-times, outside of any timezone. Here, the end date is NOT included. - a date-time-offset-range
2023-01-01T00:00:00+02:00--2023-01-02T00:00:00+02:00represents the interval between two points in the time scale, defined in reference to UTC. Here, the end date is NOT included.
In the spec, dates can be separated with the ”/” (slash) character, but this could break URLs when serializing ranges as query parameters values
?date=2023-01-01/2023-01-31, so the Lucca API does not officially support it. Besides, the Lucca API does not support ranges defined as a date and a duration either.".." characters:
..--2023-01-01: until Jan. 1st 2023 ;2023-01-01--..: since Jan. 1st 2023.
Fractional Seconds
Bounds of date-time-local-ranges and date-time-offset-ranges accept fractional seconds, so a timestamp read from a response (e.g.2025-01-14T23:08:54.9358662+00:00) can be reused as a bound as is.
Durations (time intervals)
A duration represents the length of the interval between two points in the time scale. Duration ISO value Same as with dates and date-times, durations (or time intervals) also conform to the ISO 8601 standard, whose ABNF grammar is:P2DT12H30M23S indicates “2 days, 12 hours, 30 minutes and 23 seconds”.
Unit & Value
In time management, work durations are often handled either:
- as a number of hours,
- or as a fraction of days.
Enumerations
In the Lucca API, enumerations are string typed, non-nullable, and must be considered extensible. You should be aware of the extensible nature of all enumerations. It means that adding a new value to an existing enumeration is not considered a breaking change in the Lucca API. Therefore, your code should prepare for it. The OpenAPI specification lists the values an enumeration has today. When you validate or deserialize responses against it:- Don’t reject an unknown value. Strict validators reject a value that is not in
enum: treat it as a warning, or relax response enums before validating. - Give generated enums a fallback. Map unknown values to an “unknown” member, or keep the raw string, rather than failing deserialization.
- Handle the unknown case in your logic. For example, ignore an unknown value in a list, or show it as is.