Merge pull request #47 from fkautz/pr_out_removing_date_format_method

This commit is contained in:
Frederick F. Kautz IV 2015-01-23 17:21:24 -08:00
commit a3c0440b4a
1 changed files with 6 additions and 6 deletions

View File

@ -36,6 +36,10 @@ const (
jsonType = iota
)
const (
dateFormat = "2006-01-02T15:04:05.000Z"
)
type minioApi struct {
storage mstorage.Storage
}
@ -220,7 +224,7 @@ func generateBucketsListResult(buckets []mstorage.BucketMetadata) (data BucketLi
for _, bucket := range buckets {
listbucket := &Bucket{
Name: bucket.Name,
CreationDate: formatDate(bucket.Created),
CreationDate: bucket.Created.Format(dateFormat),
}
listbuckets = append(listbuckets, listbucket)
}
@ -243,7 +247,7 @@ func generateObjectsListResult(bucket string, objects []mstorage.ObjectMetadata)
for _, object := range objects {
content := &Item{
Key: object.Key,
LastModified: formatDate(object.Created),
LastModified: object.Created.Format(dateFormat),
ETag: object.ETag,
Size: object.Size,
StorageClass: "STANDARD",
@ -259,7 +263,3 @@ func generateObjectsListResult(bucket string, objects []mstorage.ObjectMetadata)
}
return
}
func formatDate(t time.Time) string {
return t.Format("2006-01-02T15:04:05.000Z")
}