ExportOptions Model
Definition
public struct ExportOptions: Sendable {
public var dateRange: ClosedRange<Date>
public var tagIds: Set<UUID>? // nil = all tags
public var includeUntagged: Bool
public var includeRunning: Bool
public var includeColumns: Set<Column>
public var dateFormat: String
public var timeFormat: String
} Column Enum
Available columns for CSV export:
public enum Column: String, CaseIterable, Sendable {
case date
case startTime
case endTime
case duration
case tag
case comment
} Properties
| Property | Type | Default | Description |
|---|---|---|---|
dateRange | ClosedRange<Date> | required | Start and end dates for export |
tagIds | Set<UUID>? | nil | Filter to specific tags (nil = all) |
includeUntagged | Bool | true | Include records without tags |
includeRunning | Bool | true | Include records still running |
includeColumns | Set<Column> | all | Which columns to include in output |
dateFormat | String | "yyyy-MM-dd" | Date formatting pattern |
timeFormat | String | "HH:mm" | Time formatting pattern |
Usage
let options = ExportOptions(
dateRange: startDate...endDate,
tagIds: [workTagId],
includeUntagged: false,
includeRunning: false,
includeColumns: [.date, .duration, .tag],
dateFormat: "MM/dd/yyyy",
timeFormat: "h:mm a"
) Related
- 302-export - ExportService using these options
- 201-tag - Tag filtering
- 202-time-record - Records being exported