mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-03-17 20:47:57 +02:00
Add MarshalJSON method for Time type
This commit is contained in:
parent
d8ff51da51
commit
b00c22d526
6
issue.go
6
issue.go
@ -344,6 +344,12 @@ func (t *Time) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON will transform the time.Time into a JIRA time
|
||||
// during the creation of a JIRA request
|
||||
func (t Time) MarshalJSON() ([]byte, error) {
|
||||
return []byte(time.Time(t).Format("\"2006-01-02T15:04:05.999-0700\"")), nil
|
||||
}
|
||||
|
||||
// UnmarshalJSON will transform the JIRA date into a time.Time
|
||||
// during the transformation of the JIRA JSON response
|
||||
func (t *Date) UnmarshalJSON(b []byte) error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user