Improved EventDateInfo and set date as optional

This commit is contained in:
Alexander Cerutti
2025-10-31 18:28:22 +01:00
parent 019019d4d3
commit e7e3424074

View File

@@ -28,9 +28,8 @@ export const CurrencyAmount = Joi.object<CurrencyAmount>().keys({
* @see \<undiclosed> * @see \<undiclosed>
*/ */
export type EventDateInfo = export interface EventDateInfo {
| { date?: string;
date: string;
ignoreTimeComponents?: boolean; ignoreTimeComponents?: boolean;
timeZone?: string; timeZone?: string;
@@ -41,11 +40,11 @@ export type EventDateInfo =
* Leads to showing "TBA" in the UI when `date` is set. * Leads to showing "TBA" in the UI when `date` is set.
* Setting `ignoreTimeComponents` to true, has higher priority * Setting `ignoreTimeComponents` to true, has higher priority
* over this property. * over this property.
*
* When both `date` and `semantics.eventStartDate` are unset,
* `Date: TBA` will be shown in the UI.
*/ */
unannounced?: boolean; unannounced?: boolean;
}
| {
date?: string;
/** /**
* @iOSVersion 18.1 * @iOSVersion 18.1
@@ -57,13 +56,11 @@ export type EventDateInfo =
* *
* This property has higher priority over `unannounced`. * This property has higher priority over `unannounced`.
* *
* --- Implementation note --- * When both `date` and `semantics.eventStartDate` are unset,
* * `Date: TBD` will be shown in the UI.
* This is the reason it was splitted from unannounced above.
* Furthermore, it apparently can live without specifying `date`.
*/ */
undetermined: boolean; undetermined?: boolean;
}; }
export const EventDateInfo = Joi.alternatives( export const EventDateInfo = Joi.alternatives(
Joi.object<EventDateInfo>().keys({ Joi.object<EventDateInfo>().keys({