...
|
...
|
@@ -34,16 +34,16 @@ func (period *ProductCalendarBreakTimePeriod) CheckOverDay() (bool, error) { |
|
|
|
|
|
func (period *ProductCalendarBreakTimePeriod) GetCheckBeginTime(t time.Time) time.Time {
|
|
|
y, m, d := t.Date()
|
|
|
inHour, _ := strconv.Atoi(strings.Split(period.BeginAt, ":")[0])
|
|
|
inMinuter, _ := strconv.Atoi(strings.Split(period.BeginAt, ":")[1])
|
|
|
return time.Date(y, m, d, inHour, inMinuter, 0, 0, t.Location())
|
|
|
inHour, _ := strconv.ParseInt(strings.Split(period.BeginAt, ":")[0], 10, 64)
|
|
|
inMinuter, _ := strconv.ParseInt(strings.Split(period.BeginAt, ":")[1], 10, 64)
|
|
|
return time.Date(y, m, d, int(inHour), int(inMinuter), 0, 0, time.Local)
|
|
|
}
|
|
|
|
|
|
func (period *ProductCalendarBreakTimePeriod) GetCheckEndTime(t time.Time) time.Time {
|
|
|
y, m, d := t.Date()
|
|
|
inHour, _ := strconv.Atoi(strings.Split(period.EndAt, ":")[0])
|
|
|
inMinuter, _ := strconv.Atoi(strings.Split(period.EndAt, ":")[1])
|
|
|
checkTime := time.Date(y, m, d, inHour, inMinuter, 0, 0, t.Location())
|
|
|
inHour, _ := strconv.ParseInt(strings.Split(period.EndAt, ":")[0], 10, 64)
|
|
|
inMinuter, _ := strconv.ParseInt(strings.Split(period.EndAt, ":")[1], 10, 64)
|
|
|
checkTime := time.Date(y, m, d, int(inHour), int(inMinuter), 0, 0, time.Local)
|
|
|
if overDay, err := period.CheckOverDay(); overDay && err == nil {
|
|
|
return checkTime.AddDate(0, 0, 1)
|
|
|
}
|
...
|
...
|
|