Authored by 陶雨

抽奖活动编辑页在提交时对开始时间结束时间做判断

@@ -44,6 +44,11 @@ $("#beginTimeStr,#endTimeStr").change(function() { @@ -44,6 +44,11 @@ $("#beginTimeStr,#endTimeStr").change(function() {
44 }); 44 });
45 45
46 e.init(); 46 e.init();
  47 +e.on("validate", function() {
  48 + if(new Date($("#beginTimeStr").val()).getTime() >= new Date($("#endTimeStr").val()).getTime()) {
  49 + return "开始时间必须小于结束时间";
  50 + }
  51 +});
47 52
48 e.on("validate",function() { 53 e.on("validate",function() {
49 var bkStyle = []; 54 var bkStyle = [];
@@ -44,10 +44,10 @@ @@ -44,10 +44,10 @@
44 <div class="form-group"> 44 <div class="form-group">
45 <label class="col-sm-2 control-label">活动时间<span class="red">*</span></label> 45 <label class="col-sm-2 control-label">活动时间<span class="red">*</span></label>
46 <div class="col-sm-3"> 46 <div class="col-sm-3">
47 - <input type="text" class="form-control" jsaction="time:end:endTimeStr" id="beginTimeStr" required placeholder="活动开始时间" value="{{beginTimeStr}}" readonly> 47 + <input type="text" class="form-control" jsaction="time" id="beginTimeStr" required placeholder="活动开始时间" value="{{beginTimeStr}}" readonly>
48 </div> 48 </div>
49 <div class="col-sm-3"> 49 <div class="col-sm-3">
50 - <input type="text" class="form-control" jsaction="time:start:beginTimeStr" id="endTimeStr" required placeholder="活动结束时间" value="{{endTimeStr}}" readonly > 50 + <input type="text" class="form-control" jsaction="time" id="endTimeStr" required placeholder="活动结束时间" value="{{endTimeStr}}" readonly >
51 </div> 51 </div>
52 <div class="col-sm-3"> 52 <div class="col-sm-3">
53 <label class="control-label" id="totalHours"></label> 53 <label class="control-label" id="totalHours"></label>