mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-03-25 21:28:55 +02:00
Add MarshalJSON method for Date (untested)
This commit is contained in:
parent
1a2c703f7f
commit
3efb46493f
8
issue.go
8
issue.go
@ -367,6 +367,14 @@ func (t *Date) UnmarshalJSON(b []byte) error {
|
||||
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.
|
||||
// One Worklog contains zero or n WorklogRecords
|
||||
// JIRA Wiki: https://confluence.atlassian.com/jira/logging-work-on-an-issue-185729605.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user