mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-06-27 00:21:07 +02:00
Add MarshalJSON method for Date (untested)
This commit is contained in:
8
issue.go
8
issue.go
@ -367,6 +367,14 @@ func (t *Date) UnmarshalJSON(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON will transform the Date object into a short
|
||||||
|
// date string as JIRA expects during the creation of a
|
||||||
|
// JIRA request
|
||||||
|
func (t Date) MarshalJSON() ([]byte, error) {
|
||||||
|
time := time.Time(t)
|
||||||
|
return []byte(time.Format("\"2006-01-02\"")), nil
|
||||||
|
}
|
||||||
|
|
||||||
// Worklog represents the work log of a JIRA issue.
|
// Worklog represents the work log of a JIRA issue.
|
||||||
// One Worklog contains zero or n WorklogRecords
|
// One Worklog contains zero or n WorklogRecords
|
||||||
// JIRA Wiki: https://confluence.atlassian.com/jira/logging-work-on-an-issue-185729605.html
|
// JIRA Wiki: https://confluence.atlassian.com/jira/logging-work-on-an-issue-185729605.html
|
||||||
|
Reference in New Issue
Block a user