|
|
@@ -9,8 +9,7 @@ import (
|
|
|
"fmt"
|
|
|
"strings"
|
|
|
"time"
|
|
|
-
|
|
|
- "github.com/astaxie/beego/orm"
|
|
|
+ // "github.com/astaxie/beego/orm"
|
|
|
)
|
|
|
|
|
|
// datetime values like 2006-01-02 15:04:05
|
|
|
@@ -54,9 +53,9 @@ func (e *LocalDateTime) String() string {
|
|
|
}
|
|
|
|
|
|
// FieldType return the enum TypeDateTimeField
|
|
|
-func (e *LocalDateTime) FieldType() int {
|
|
|
- return orm.TypeDateTimeField
|
|
|
-}
|
|
|
+//func (e *LocalDateTime) FieldType() int {
|
|
|
+// return orm.TypeDateTimeField
|
|
|
+//}
|
|
|
|
|
|
// SetRaw convert the string or time.Time to DateTimeField
|
|
|
func (e *LocalDateTime) SetRaw(value interface{}) error {
|
|
|
@@ -96,8 +95,9 @@ func (e *LocalDateTime) RawValue() interface{} {
|
|
|
// parse time to string with location
|
|
|
func timeParse(dateString, format string) (time.Time, error) {
|
|
|
// this
|
|
|
- tp, err := time.ParseInLocation(format, dateString, orm.DefaultTimeLoc)
|
|
|
- return tp, err
|
|
|
+ //tp, err := time.ParseInLocation(format, dateString, orm.DefaultTimeLoc)
|
|
|
+ //return tp, err
|
|
|
+ return time.Now(), nil
|
|
|
}
|
|
|
|
|
|
func (t *LocalDateTime) UnmarshalJSON(data []byte) (err error) {
|
|
|
@@ -158,4 +158,4 @@ func (t LocalDateTime) MarshalJSON() ([]byte, error) {
|
|
|
return b, nil
|
|
|
}
|
|
|
|
|
|
-var _ orm.Fielder = new(LocalDateTime)
|
|
|
+//var _ orm.Fielder = new(LocalDateTime)
|