common.js
879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function null2String(s){
if(!s){
return "";
}
return s;
}
function DateCheck(fromDate,fromTime,toDate,toTime,msg){
var begin = new Date(fromDate.replace(/\-/g, "\/"));
var end = new Date(toDate.replace(/\-/g, "\/"));
if(fromTime != "" && toTime != ""){
begin = new Date(fromDate.replace(/\-/g, "\/")+" "+fromTime+":00");
end = new Date(toDate.replace(/\-/g, "\/")+" "+toTime+":00");
if(fromDate!=""&&toDate!=""&&begin >end)
{
WfForm.showMessage(msg);
return false;
}
}else{
if(fromDate!=""&&toDate!=""&&begin >end)
{
WfForm.showMessage(msg);
return false;
}
}
return true;
}
function durationCheck(duration,msg){
if(duration){
if(parseFloat(duration) <= 0){
WfForm.showMessage(msg);
return false;
}
}else{
WfForm.showMessage(msg);
return false;
}
return true;
}