|
|
|
@@ -148,8 +148,7 @@ func (m *crmdMeeting) validateFormInput(form url.Values) bool { |
|
|
|
starthour, hok := form["starthour"] |
|
|
|
duration, rok := form["duration"] |
|
|
|
if sok && hok && rok { |
|
|
|
m.buildStartDate(startdate[0], starthour[0]) |
|
|
|
m.buildDuration(duration[0]) |
|
|
|
m.buildStartDate(startdate[0], starthour[0], duration[0]) |
|
|
|
} else { |
|
|
|
m.addSpaErr("活动日期,开始时间,持续时间 不能为空") |
|
|
|
} |
|
|
|
@@ -183,7 +182,7 @@ func (m *crmdMeeting) validateFormFile(r *http.Request) (ok bool) { |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdMeeting) buildStartDate(date, hour string) { |
|
|
|
func (m *crmdMeeting) buildStartDate(date, hour, duration string) { |
|
|
|
layout := "2 January, 2006 15:04" |
|
|
|
value := strings.TrimSpace(date) + " " + strings.TrimSpace(hour) |
|
|
|
t, err := time.Parse(layout, value) |
|
|
|
@@ -193,6 +192,9 @@ func (m *crmdMeeting) buildStartDate(date, hour string) { |
|
|
|
} |
|
|
|
m.DateStart = t.Format(getCrmTimeLayout()) |
|
|
|
log.Println(m.DateStart) |
|
|
|
|
|
|
|
m.buildDuration(duration) |
|
|
|
m.DateEnd = t.Add(time.Second * time.Duration(m.Duration)).Format(getCrmTimeLayout()) |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdMeeting) buildDuration(duration string) { |