|
|
@ -179,7 +179,7 @@ func matchPeriodPattern01(base time.Time, str string) (startimer.StarTimer, erro
|
|
|
|
func matchPeroidPattern02(base time.Time, str string) (startimer.StarTimer, error) {
|
|
|
|
func matchPeroidPattern02(base time.Time, str string) (startimer.StarTimer, error) {
|
|
|
|
str = transChn(str)
|
|
|
|
str = transChn(str)
|
|
|
|
var rpt startimer.Repeats
|
|
|
|
var rpt startimer.Repeats
|
|
|
|
reg := regexp.MustCompile(`(每)?([周星期礼拜][周礼拜星期到1-6日天]+)+的?([上中下午夜早凌清晨傍晚里]+)?(\d{1,4}[个点时:]+)?(\d{1,4}[分:])?(\d{1,10}秒?)?`)
|
|
|
|
reg := regexp.MustCompile(`(每)?([周星期礼拜][周礼拜星期到1-6日天]+)+的?([上中下午夜早凌清晨傍晚里]+)?(\d{1,4}[个点时:]+)?(\d{0,4}[分半:]?钟?)?(\d{1,10}秒?钟?)?`)
|
|
|
|
if reg.MatchString(str) {
|
|
|
|
if reg.MatchString(str) {
|
|
|
|
pts := reg.FindStringSubmatch(str)
|
|
|
|
pts := reg.FindStringSubmatch(str)
|
|
|
|
if pts[2] != "" {
|
|
|
|
if pts[2] != "" {
|
|
|
@ -236,6 +236,9 @@ func matchPeroidPattern02(base time.Time, str string) (startimer.StarTimer, erro
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_HOUR, Value: hour})
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_HOUR, Value: hour})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if pts[5] != "" {
|
|
|
|
if pts[5] != "" {
|
|
|
|
|
|
|
|
if pts[5] == "半" {
|
|
|
|
|
|
|
|
pts[5] = "30"
|
|
|
|
|
|
|
|
}
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_MINUTE, Value: uint32(getNumbers(pts[5]))})
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_MINUTE, Value: uint32(getNumbers(pts[5]))})
|
|
|
|
} else if hour != 0 {
|
|
|
|
} else if hour != 0 {
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_MINUTE, Value: 0})
|
|
|
|
rpt.Repeat = append(rpt.Repeat, startimer.Repeat{Unit: startimer.STAR_MINUTE, Value: 0})
|
|
|
|