func DateField(name string) *Field {
	return FieldWithType(name, common.DATE)
}
DateField creates a default date input field with the given name.
package fields
import (
	"reflect"
	"time"
	"github.com/coscms/forms/common"
)
const (
	DATETIME_FORMAT = "2006-01-02 15:05"
	DATE_FORMAT     = "2006-01-02"
	TIME_FORMAT     = "15:05"
)
func ConvertTime(v interface{}) (time.Time, bool) {
	t, ok := v.(time.Time)
	var isEmpty bool
	if !ok {
		var timestamp int64
		switch i := v.(type) {
		case int:
			timestamp = int64(i)
		case int64:
			timestamp = i
		}
		if timestamp > 0 {
			t = time.Unix(timestamp, 0)
		} else {
			isEmpty = true
		}
	}
	return t, isEmpty
}
func DatetimeField(name string) *Field {
	return FieldWithType(name, common.DATETIME)
}