Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimeEntry ¶
type TimeEntry struct { // ID is a system id which may be set from a persistor ID int // Tag is used for grouping Tag string // Some text attached to entry Note string // When has the author started working on the note Start time.Time // End time Stop *time.Time // time entry duration in seconds. If the time entry is currently running, the duration attribute contains a negative value, denoting the start of the time entry in seconds since epoch (Jan 1 1970). The correct duration can be calculated as current_time + duration, where current_time is the current time in seconds since epoch. Duration int64 // TimeEntry belongs to project Project string // // TimeEntry belongs to client Client string }
TimeEntry represents a simple note
type TogglDuration ¶ added in v0.5.0
type TogglDuration struct {
// contains filtered or unexported fields
}
TogglDuration is used to pretty print a toggl duration
func NewTogglDuration ¶ added in v0.5.0
func NewTogglDuration(duration int64) (*TogglDuration, error)
NewTogglDuration creates a new instance
func TogglDurationFromTime ¶ added in v0.5.0
func TogglDurationFromTime(t time.Time) (*TogglDuration, error)
TogglDurationFromTime formats a time like the duration
Known caveat: this forgets about days
func (*TogglDuration) GetDuration ¶ added in v0.5.0
func (td *TogglDuration) GetDuration() int64
func (*TogglDuration) OmitSeconds ¶ added in v0.5.0
func (td *TogglDuration) OmitSeconds()
OmitSeconds tells the converter to not print seconds
func (*TogglDuration) ShowSeconds ¶ added in v0.5.0
func (td *TogglDuration) ShowSeconds()
ShowSeconds tells the converter to print seconds
func (*TogglDuration) String ¶ added in v0.5.0
func (td *TogglDuration) String() string
String returns a properly readable string for a duration in seconds
Click to show internal directories.
Click to hide internal directories.