partialDateDiff( )
找出两个日期之差。
语法
就此功能可能包含部分日期组成部分而言,日期与两个日期(秒/分钟/小时/天/月/年)的第一个定义部分相比。例如,如果比较以下两个日期:
01-Jun-2011 11:12:1402-Jan-2011 17:UNK:UNK
01-Jun-2011 1102-Jan-2011 17
注意:
这是 JavaScript 函数。规则变量名称中不需要引号。partialDateDiff(date1,isPartial1,date2,isPartial2,Datepart)
参数
返回值
表示两个日期之间的差异的数字。
使用小于或等于确切值的最近整数返回差异。例如,如果 2 个日期之间的差值为 1.5 小时,则返回 1 小时作为小时数差异。
示例 3-41 将一个完整的 DateTime 项目与一个部分 DateTime 项目进行比较
// Given 2 form questions of type DateTime are defined in the rule as variables
// date1 is a full date containing the value of 05-NOV-2021
// date2 is a partial date containing the value of UNK-OCT-2021
if(partialDateDiff(date1, false, date2, true, 'Day') > 28){
returntrue;
}
else{
returnfalse; // Query is triggered if the difference between dates is greater than 28 days.
}
// The difference between dates is '31', the query will not be triggered父主题:日期和时间函数