Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package util
import (
"fmt"
"time"
)
const (
// TimeFormat .
TimeFormat = "2006-01-02 15:04:05"
)
// JSONTime .
type JSONTime time.Time
// MarshalJSON .
func (jt JSONTime) MarshalJSON() ([]byte, error) {
stamp := fmt.Sprintf("%q", time.Time(jt).Format(TimeFormat))
return []byte(stamp), nil
}
// Before .
func (jt JSONTime) Before(t time.Time) bool {
return time.Time(jt).Before(t)
}