How to set the default time format for serialization of MVC response objects?
- Dominant language
- Go
- Stars
- 25.6k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
How should I set up MVC What is the format of the date and time when serializing objects in Response?
`
func (this *BussApiController) GetActivityBySearch() mvc.Result {
ActivityList,total := loadFromDB(...)
return mvc.Response{
Object: iris.Map{"success": success, "message": message, "activityList": ActivityList, "total": total},
}
}
`
I used to be able to set the default time format for JSON serialization using the GitHub. com/liamylian/jsontime/v2/v2 package when using v12.2.8. However, after upgrading to v12.2.11, this method has become ineffective.
`import(
...
jsonTime "github.com/liamylian/jsontime/v2/v2"
)
func main() {
jsonTime.SetDefaultTimeFormat("2006-01-02 15:04:05", time.Local)
...
}
`
Contributor guide
Assessment
This issue has not been assessed yet.