|
@@ -34,16 +34,16 @@ func (period *ProductCalendarBreakTimePeriod) CheckOverDay() (bool, error) { |
|
@@ -34,16 +34,16 @@ func (period *ProductCalendarBreakTimePeriod) CheckOverDay() (bool, error) { |
34
|
|
34
|
|
35
|
func (period *ProductCalendarBreakTimePeriod) GetCheckBeginTime(t time.Time) time.Time {
|
35
|
func (period *ProductCalendarBreakTimePeriod) GetCheckBeginTime(t time.Time) time.Time {
|
36
|
y, m, d := t.Date()
|
36
|
y, m, d := t.Date()
|
37
|
- inHour, _ := strconv.Atoi(strings.Split(period.BeginAt, ":")[0])
|
|
|
38
|
- inMinuter, _ := strconv.Atoi(strings.Split(period.BeginAt, ":")[1])
|
|
|
39
|
- return time.Date(y, m, d, inHour, inMinuter, 0, 0, t.Location())
|
37
|
+ inHour, _ := strconv.ParseInt(strings.Split(period.BeginAt, ":")[0], 10, 64)
|
|
|
38
|
+ inMinuter, _ := strconv.ParseInt(strings.Split(period.BeginAt, ":")[1], 10, 64)
|
|
|
39
|
+ return time.Date(y, m, d, int(inHour), int(inMinuter), 0, 0, time.Local)
|
40
|
}
|
40
|
}
|
41
|
|
41
|
|
42
|
func (period *ProductCalendarBreakTimePeriod) GetCheckEndTime(t time.Time) time.Time {
|
42
|
func (period *ProductCalendarBreakTimePeriod) GetCheckEndTime(t time.Time) time.Time {
|
43
|
y, m, d := t.Date()
|
43
|
y, m, d := t.Date()
|
44
|
- inHour, _ := strconv.Atoi(strings.Split(period.EndAt, ":")[0])
|
|
|
45
|
- inMinuter, _ := strconv.Atoi(strings.Split(period.EndAt, ":")[1])
|
|
|
46
|
- checkTime := time.Date(y, m, d, inHour, inMinuter, 0, 0, t.Location())
|
44
|
+ inHour, _ := strconv.ParseInt(strings.Split(period.EndAt, ":")[0], 10, 64)
|
|
|
45
|
+ inMinuter, _ := strconv.ParseInt(strings.Split(period.EndAt, ":")[1], 10, 64)
|
|
|
46
|
+ checkTime := time.Date(y, m, d, int(inHour), int(inMinuter), 0, 0, time.Local)
|
47
|
if overDay, err := period.CheckOverDay(); overDay && err == nil {
|
47
|
if overDay, err := period.CheckOverDay(); overDay && err == nil {
|
48
|
return checkTime.AddDate(0, 0, 1)
|
48
|
return checkTime.AddDate(0, 0, 1)
|
49
|
}
|
49
|
}
|