model

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTask    = 0
	TypeProject = 1

	StatusOpen      = 0
	StatusCancelled = 2
	StatusCompleted = 3

	StartInbox   = 0
	StartAnytime = 1
	StartSomeday = 2
)

Variables

This section is empty.

Functions

func CoreDataToTime

func CoreDataToTime(ts float64) time.Time

CoreDataToTime converts a Core Data timestamp (seconds since 2001-01-01) to time.Time.

func TimeToCoreData

func TimeToCoreData(t time.Time) float64

TimeToCoreData converts a time.Time to Core Data timestamp.

Types

type Area

type Area struct {
	UUID    string `json:"uuid"`
	Title   string `json:"title"`
	Visible bool   `json:"visible"`
}

type ChecklistItem

type ChecklistItem struct {
	UUID     string     `json:"uuid"`
	Title    string     `json:"title"`
	Status   int        `json:"status"`
	StopDate *time.Time `json:"stopDate,omitempty"`
	Index    int        `json:"index"`
}

type Project

type Project struct {
	UUID      string   `json:"uuid"`
	Title     string   `json:"title"`
	Status    int      `json:"status"`
	AreaUUID  string   `json:"areaUUID,omitempty"`
	AreaTitle string   `json:"areaTitle,omitempty"`
	Tags      []string `json:"tags,omitempty"`
	TaskCount int      `json:"taskCount"`
	OpenCount int      `json:"openCount"`
}

type Tag

type Tag struct {
	UUID       string `json:"uuid"`
	Title      string `json:"title"`
	Shortcut   string `json:"shortcut,omitempty"`
	ParentUUID string `json:"parentUUID,omitempty"`
}

type Task

type Task struct {
	UUID         string      `json:"uuid"`
	Title        string      `json:"title"`
	Notes        string      `json:"notes,omitempty"`
	Type         int         `json:"type"`
	Status       int         `json:"status"`
	Start        int         `json:"start"`
	StartBucket  int         `json:"startBucket"`
	StartDate    *ThingsDate `json:"startDate,omitempty"`
	Deadline     *ThingsDate `json:"deadline,omitempty"`
	StopDate     *time.Time  `json:"stopDate,omitempty"`
	CreationDate *time.Time  `json:"creationDate,omitempty"`
	Trashed      bool        `json:"trashed"`
	ProjectUUID  string      `json:"projectUUID,omitempty"`
	ProjectTitle string      `json:"projectTitle,omitempty"`
	AreaUUID     string      `json:"areaUUID,omitempty"`
	AreaTitle    string      `json:"areaTitle,omitempty"`
	HeadingUUID  string      `json:"headingUUID,omitempty"`
	HeadingTitle string      `json:"headingTitle,omitempty"`
	Tags         []string    `json:"tags,omitempty"`
	Index        int         `json:"index"`
	TodayIndex   int         `json:"todayIndex"`
}

type ThingsDate

type ThingsDate int64

ThingsDate is a bit-encoded date: year<<16 | month<<12 | day<<7.

func ThingsDateFromTime

func ThingsDateFromTime(t time.Time) ThingsDate

func (ThingsDate) MarshalJSON added in v0.3.0

func (d ThingsDate) MarshalJSON() ([]byte, error)

MarshalJSON renders the date as YYYY-MM-DD so jq/agents/scripts see a real date rather than the bit-encoded int.

func (ThingsDate) String

func (d ThingsDate) String() string

func (ThingsDate) ToTime

func (d ThingsDate) ToTime() time.Time

func (*ThingsDate) UnmarshalJSON added in v0.3.0

func (d *ThingsDate) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL