Compare commits

...

1 Commits

Author SHA1 Message Date
dtapps 1b8a3a8b18 - 增加 `FormatFilter`
4 days ago

@ -13,7 +13,7 @@
#### 安装
```shell
go get -v -u go.dtapp.net/gotime@v1.0.8
go get -v -u go.dtapp.net/gotime@v1.0.9
```
#### 使用

@ -91,6 +91,15 @@ func (p Pro) Format() string {
return p.Time.Format(DateTimeFormat)
}
// FormatFilter 今天此刻格式化 带 过滤无效时间
func (p Pro) FormatFilter() string {
if p.Time.Format(DateTimeFormat) == "0001-01-01 00:00:00" || p.Time.Format(DateTimeFormat) == "0001-01-01 08:05:43" {
return ""
} else {
return p.Time.Format(DateTimeFormat)
}
}
// ToDateFormat 今天此刻日期
func (p Pro) ToDateFormat() string {
return p.Time.Format(DateFormat)

@ -1,3 +1,3 @@
package gotime
const Version = "1.0.8"
const Version = "1.0.9"

Loading…
Cancel
Save