|
@@ -58,6 +58,7 @@ func (t Date) FromString(str string) Date {
|
|
|
}
|
|
|
|
|
|
func ParseDate(str string) Date {
|
|
|
+ str = strings.TrimSpace(str)
|
|
|
tm, err := time.Parse(NormalDateFormat, str)
|
|
|
if nil != err {
|
|
|
return Unix(0, 0).ToDate()
|
|
@@ -87,6 +88,7 @@ func (t *Date) Scan(value interface{}) error {
|
|
|
}
|
|
|
|
|
|
func (t Date) Format(layout string) string {
|
|
|
+ layout = strings.TrimSpace(layout)
|
|
|
return t.T().Format(layout)
|
|
|
}
|
|
|
|