diff --git a/README.md b/README.md index 12e496c..82111e6 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,13 @@ ๐Ÿ“ฆ Golang ๆ—ถ้—ด [comment]: <> (go) -[![godoc](https://pkg.go.dev/badge/github.com/dtapps/gotime?status.svg)](https://pkg.go.dev/github.com/dtapps/gotime) -[![goproxy.cn](https://goproxy.cn/stats/github.com/dtapps/gotime/badges/download-count.svg)](https://goproxy.cn/stats/github.com/dtapps/gotime) -[![goreportcard.com](https://goreportcard.com/badge/github.com/dtapps/gotime)](https://goreportcard.com/report/github.com/dtapps/gotime) -[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/github.com%2Fdtapps%2Fgotime) +[![godoc](https://pkg.go.dev/badge/go.dtapp.net/gotime?status.svg)](https://pkg.go.dev/go.dtapp.net/gotime) +[![goproxy.cn](https://goproxy.cn/stats/go.dtapp.net/gotime/badges/download-count.svg)](https://goproxy.cn/stats/go.dtapp.net/gotime) +[![goreportcard.com](https://goreportcard.com/badge/go.dtapp.net/gotime)](https://goreportcard.com/report/go.dtapp.net/gotime) +[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/go.dtapp.net%2Fgotime) #### ๅฎ‰่ฃ… ```go -go get -v -u github.com/dtapps/gotime +go get -v -u go.dtapp.net/gotime ``` \ No newline at end of file diff --git a/go.mod b/go.mod index 54fc872..f7f33fd 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/dtapps/gotime +module go.dtapp.net/gotime go 1.18 diff --git a/gotime.go b/gotime.go index 3bd7dfe..9123a59 100644 --- a/gotime.go +++ b/gotime.go @@ -36,42 +36,42 @@ func NewPro() Pro { } // BeforeSeconds ่Žทๅ–n็ง’ๅ‰็š„ๆ—ถ้—ด -func (p Pro) BeforeSeconds(seconds int) Pro { +func (p Pro) BeforeSeconds(seconds int64) Pro { st, _ := time.ParseDuration(fmt.Sprintf("-%ds", seconds)) p.Time = p.Time.Add(st) return p } // AfterSeconds ่Žทๅ–n็ง’ๅŽ็š„ๆ—ถ้—ด -func (p Pro) AfterSeconds(seconds int) Pro { +func (p Pro) AfterSeconds(seconds int64) Pro { st, _ := time.ParseDuration(fmt.Sprintf("+%ds", seconds)) p.Time = p.Time.Add(st) return p } // BeforeMinute ่Žทๅ–nๅˆ†้’Ÿๅ‰็š„ๆ—ถ้—ด -func (p Pro) BeforeMinute(seconds int) Pro { +func (p Pro) BeforeMinute(seconds int64) Pro { st, _ := time.ParseDuration(fmt.Sprintf("-%dm", seconds)) p.Time = p.Time.Add(st) return p } // AfterMinute ่Žทๅ–nๅˆ†้’ŸๅŽ็š„ๆ—ถ้—ด -func (p Pro) AfterMinute(seconds int) Pro { +func (p Pro) AfterMinute(seconds int64) Pro { st, _ := time.ParseDuration(fmt.Sprintf("+%dm", seconds)) p.Time = p.Time.Add(st) return p } // BeforeHour ่Žทๅ–nๅฐๆ—ถๅ‰็š„ๆ—ถ้—ด -func (p Pro) BeforeHour(hour int) Pro { +func (p Pro) BeforeHour(hour int64) Pro { st, _ := time.ParseDuration(fmt.Sprintf("-%dh", hour)) p.Time = p.Time.Add(st) return p } // AfterHour ่Žทๅ–nๅฐๆ—ถๅŽ็š„ๆ—ถ้—ด -func (p Pro) AfterHour(hour int) Pro { +func (p Pro) AfterHour(hour int64) Pro { st, _ := time.ParseDuration(fmt.Sprintf("+%dh", hour)) p.Time = p.Time.Add(st) return p @@ -95,11 +95,11 @@ func (p Pro) SetFormat(layout string) string { } // Month ่Žทๅ–ๅฝ“ๅ‰ๆœˆ -func (p Pro) Month() int { +func (p Pro) Month() int64 { return p.MonthOfYear() } // MonthOfYear ่Žทๅ–ๆœฌๅนด็š„็ฌฌๅ‡ ๆœˆ -func (p Pro) MonthOfYear() int { - return int(p.Time.In(p.loc).Month()) +func (p Pro) MonthOfYear() int64 { + return int64(p.Time.In(p.loc).Month()) } diff --git a/version.go b/version.go index 6363da3..15654f7 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package gotime -const Version = "1.0.3" +const Version = "1.0.4"