add(taskwarrior): uda for last_gitw_update with initial merge
WIP for #3. Creation of entirely new tasks is possible and works as expected. The only remaining issue is the merging of existing tasks.
This commit is contained in:
@@ -14,20 +14,22 @@ import (
|
||||
/// mentioned in the Status field
|
||||
|
||||
type Task struct {
|
||||
Id uint `json:"id,omitempty"`
|
||||
Git_id float32 `json:"git_id,omitempty"` // uda
|
||||
Git_type string `json:"git_type,omitempty"` // uda
|
||||
Project string `json:"project,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Annotations []Annotation `json:"annotations,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Due string `json:"due,omitempty"`
|
||||
Entry string `json:"entry,omitempty"`
|
||||
Modified string `json:"modified,omitempty"`
|
||||
End string `json:"end,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Urgency float32 `json:"urgency,omitempty"`
|
||||
Id uint `json:"id,omitempty"`
|
||||
Git_id float32 `json:"git_id,omitempty"` // uda
|
||||
Git_type string `json:"git_type,omitempty"` // uda
|
||||
Project string `json:"project,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Annotations []Annotation `json:"annotations,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Depends []string `json:"depends,omitempty"`
|
||||
Due string `json:"due,omitempty"`
|
||||
Entry string `json:"entry,omitempty"`
|
||||
Modified string `json:"modified,omitempty"`
|
||||
End string `json:"end,omitempty"`
|
||||
Last_gitw_update string `json:"last_gitw_update,omitempty"` // uda
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Urgency float32 `json:"urgency,omitempty"`
|
||||
}
|
||||
|
||||
type Annotation struct {
|
||||
@@ -47,17 +49,21 @@ func NewTask(description string, project string, git_id uint, git_type Type, tag
|
||||
// TODO: update task struct to include the new user defined value, which shall
|
||||
// also be provided as an argument
|
||||
return Task{
|
||||
Project: project,
|
||||
Description: description,
|
||||
Git_id: float32(git_id),
|
||||
Git_type: string(git_type),
|
||||
Tags: tags,
|
||||
Project: project,
|
||||
Description: description,
|
||||
Git_id: float32(git_id),
|
||||
Git_type: string(git_type),
|
||||
Last_gitw_update: GoTimeToTaskTime(time.Now()),
|
||||
Tags: tags,
|
||||
}
|
||||
}
|
||||
|
||||
func TaskTimeToGoTime(t string) time.Time {
|
||||
// TODO: apply required changes to the string for correct parsing
|
||||
splits := strings.Split(t, "T")
|
||||
if len(t) == 0 {
|
||||
return time.UnixMicro(0)
|
||||
}
|
||||
if len(splits) != 2 {
|
||||
fmt.Fprintf(os.Stderr, "Expected exactly 2 splits")
|
||||
os.Exit(-1)
|
||||
|
||||
Reference in New Issue
Block a user