Welcome to the OpenCities help centre. Search for what you're after, or browse the categories.
Can't find what you're looking for? Submit a support ticket and we'll be in touch.

Follow

CMS DateTime Composite Field Structure

avatar of Kira Hartley

Kira Hartley

Last updated

For Date fields (Type 80), the system uses a composite CMSDateTime object that supports various date configurations including single dates, periods, multiple dates, and recurring dates. In this article:

DateType Enum Values

The dateType property in CMSDateTime objects determines how the date should be interpreted:

Value Name Description
-1 None No date type specified
1 SingleDate A single date/time value
2 Period A date range with start and end dates
3 MultipleDates Multiple individual dates
4 RecurringDates Recurring date pattern based on recurrence rules

RecurrenceType Enum Values

For recurring dates (DateType = 4), the recurrenceType specifies the pattern:

Value Name Description
10 Daily Repeats daily
20 Weekly Repeats weekly
30 Monthly Repeats monthly
40 Yearly Repeats yearly
50 None No recurrence pattern

EndRecurrenceType Enum Values

For recurring dates, the endRecurrenceType determines how the recurrence ends:

Value Name Description
10 None No end specified (infinite recurrence)
20 Occurence Ends after a specified number of occurrences
30 Date Ends on a specific date

Example CMSDateTime Usage (OpenCities Event Pages)

Single Date

{
  "OC Composite Date": {
    "Type": 80,
    "Value": {
      "_value": "2025-09-05T09:00:00",
      "_endDate": "2025-09-05T17:00:00",
      "_dateType": 1,
      "_timeZoneId": "AUS Eastern Standard Time",
      "multiDateTime": [],
      "multiDateEndTime": {},
      "_hasRecurrenceRules": false,
      "_recurrenceType": 50,
      "_endRecurrenceType": 10,
      "_recurringDateEndTime": "0001-01-01T00:00:00",
      "_endNumberOfOccurrences": 0,
      "_recursEvery": 0,
      "_exactDay": 0,
      "_approxDay": null,
      "_approxDayNumber": null,
      "recurWeeklyDays": [],
      "_exactMonth": 0,
      "additionalRecurrenceDateTime": {},
      "excludeRecurrenceDate": []
    }
  }
}

Date Period

{
  "OC Composite Date": {
    "Type": 80,
    "Value": {
      "_value": "2025-09-05T09:00:00",
      "_endDate": "2025-09-10T17:00:00",
      "_dateType": 2,
      "_timeZoneId": "AUS Eastern Standard Time",
      "multiDateTime": [],
      "multiDateEndTime": {},
      "_hasRecurrenceRules": false,
      "_recurrenceType": 50,
      "_endRecurrenceType": 10,
      "_recurringDateEndTime": "0001-01-01T00:00:00",
      "_endNumberOfOccurrences": 0,
      "_recursEvery": 0,
      "_exactDay": 0,
      "_approxDay": null,
      "_approxDayNumber": null,
      "recurWeeklyDays": [],
      "_exactMonth": 0,
      "additionalRecurrenceDateTime": {},
      "excludeRecurrenceDate": []
    }
  }
}

Multiple Dates

{
  "OC Composite Date": {
    "Type": 80,
    "Value": {
      "_value": "2025-09-05T00:00:00",
      "_endDate": null,
      "_dateType": 3,
      "_timeZoneId": "AUS Eastern Standard Time",
      "multiDateTime": [],
      "multiDateEndTime": {
        "2025-09-05T09:00:00": "2025-09-05T17:00:00",
        "2025-09-12T09:00:00": "2025-09-12T17:00:00",
        "2025-09-19T09:00:00": "2025-09-19T17:00:00"
      },
      "_hasRecurrenceRules": false,
      "_recurrenceType": 50,
      "_endRecurrenceType": 10,
      "_recurringDateEndTime": "0001-01-01T00:00:00",
      "_endNumberOfOccurrences": 0,
      "_recursEvery": 0,
      "_exactDay": 0,
      "_approxDay": null,
      "_approxDayNumber": null,
      "recurWeeklyDays": [],
      "_exactMonth": 0,
      "additionalRecurrenceDateTime": {},
      "excludeRecurrenceDate": []
    }
  }
}

Recurring Date (Weekly) - Real OpenCities Example

{
  "OC Composite Date": {
    "Type": 80,
    "Value": {
      "_value": "2025-09-05T00:00:00",
      "_endDate": "2025-09-05T23:59:00",
      "_dateType": 4,
      "_timeZoneId": "AUS Eastern Standard Time",
      "multiDateTime": [],
      "multiDateEndTime": {},
      "_hasRecurrenceRules": true,
      "_recurrenceType": 20,
      "_endRecurrenceType": 20,
      "_recurringDateEndTime": "0001-01-01T00:00:00",
      "_endNumberOfOccurrences": 25,
      "_recursEvery": 1,
      "_exactDay": 0,
      "_approxDay": null,
      "_approxDayNumber": null,
      "recurWeeklyDays": [
        "Wednesday",
        "Thursday"
      ],
      "_exactMonth": 0,
      "additionalRecurrenceDateTime": {
        "2025-09-24T00:00:00": "2025-09-24T23:59:59"
      },
      "excludeRecurrenceDate": []
    }
  }
}

Recurring Date (Monthly by Occurrence)

{
  "OC Composite Date": {
    "Type": 80,
    "Value": {
      "_value": "2025-09-01T09:00:00",
      "_endDate": "2025-09-01T17:00:00",
      "_dateType": 4,
      "_timeZoneId": "AUS Eastern Standard Time",
      "multiDateTime": [],
      "multiDateEndTime": {},
      "_hasRecurrenceRules": true,
      "_recurrenceType": 30,
      "_endRecurrenceType": 20,
      "_recurringDateEndTime": "0001-01-01T00:00:00",
      "_endNumberOfOccurrences": 12,
      "_recursEvery": 1,
      "_exactDay": 1,
      "_approxDay": null,
      "_approxDayNumber": null,
      "recurWeeklyDays": [],
      "_exactMonth": 0,
      "additionalRecurrenceDateTime": {},
      "excludeRecurrenceDate": []
    }
  }
}

Recurring Date (Daily by End Date)

{
  "OC Composite Date": {
    "Type": 80,
    "Value": {
      "_value": "2025-09-01T09:00:00",
      "_endDate": "2025-09-01T17:00:00",
      "_dateType": 4,
      "_timeZoneId": "AUS Eastern Standard Time",
      "multiDateTime": [],
      "multiDateEndTime": {},
      "_hasRecurrenceRules": true,
      "_recurrenceType": 10,
      "_endRecurrenceType": 30,
      "_recurringDateEndTime": "2025-12-31T23:59:59",
      "_endNumberOfOccurrences": 0,
      "_recursEvery": 1,
      "_exactDay": 0,
      "_approxDay": null,
      "_approxDayNumber": null,
      "recurWeeklyDays": [],
      "_exactMonth": 0,
      "additionalRecurrenceDateTime": {},
      "excludeRecurrenceDate": [
        "2025-12-25T00:00:00"
      ]
    }
  }
}

Key CMSDateTime Properties

  • _value: The primary start date/time value
  • _endDate: End date for periods or single-day events with end times
  • _dateType: Numeric value indicating the date type (see DateType enum above)
  • _timeZoneId: Time zone identifier (e.g., "AUS Eastern Standard Time")
  • multiDateEndTime: Dictionary of start/end date pairs for multiple dates
  • _hasRecurrenceRules: Boolean indicating if recurrence rules apply
  • _recurrenceType: Numeric value for recurrence pattern (see RecurrenceType enum above)
  • _endRecurrenceType: Numeric value for how recurrence ends (see EndRecurrenceType enum above)
  • _recursEvery: Interval for recurrence (e.g., every 2 weeks)
  • recurWeeklyDays: Array of weekday names for weekly recurrence (e.g., ["Monday", "Wednesday"])
  • _exactDay: Specific day of month for monthly recurrence (1-31)
  • _endNumberOfOccurrences: Number of occurrences for occurrence-based endings
  • _recurringDateEndTime: End date/time for date-based recurrence endings
  • additionalRecurrenceDateTime: Dictionary of additional dates to include in recurrence
  • excludeRecurrenceDate: Array of dates to exclude from recurrence pattern
  • _exactMonth: Specific month for yearly recurrence (1-12)
  • _approxDay: Approximate day type for flexible monthly/yearly patterns
  • _approxDayNumber: Approximate day number (first, second, third, fourth, last)

Common Time Zone Values for OpenCities

  • "AUS Eastern Standard Time" - Australian Eastern Time
  • "AUS Central Standard Time" - Australian Central Time
  • "AUS Western Standard Time" - Australian Western Time
  • "UTC" - Coordinated Universal Time
Was this article helpful?
0 out of 0 found this helpful