//onload事件
function confirmorderapply_load() {
Xrm.Page.getAttribute('new_commitmentfiledate').addOnChange(
function () {
if (compareDate(Xrm.Page.getAttribute("new_commitmentfiledate").getValue(), new Date())) {
alert("[销售承诺合同归档时间】不能小于今天");
return false;
}}
);
Xrm.Page.getAttribute('new_commitmentpaydate').addOnChange(
function () {
if (compareDate(Xrm.Page.getAttribute("new_commitmentpaydate").getValue(), new Date())) {
alert("[销售承诺预付款到账时间】不能小于今天");
return false;
}});
Xrm.Page.getAttribute('new_acceptancedate').addOnChange(
function () {
if (compareDate(Xrm.Page.getAttribute("new_acceptancedate").getValue(), new Date())) {
alert("[项目预计终验时间】不能小于今天");
return false;
}}
);
}function compareDate(comparedate, nowdate) {
var formatNowDate = new Date(nowdate.format("yyyy-MM-dd"));
var formatComparedate = new Date(comparedate.format("yyyy-MM-dd"));
var difDate = formatComparedate - formatNowDate;
if (difDate < 0)
return true;return false;
}
JS年月日判断时间大小
最新推荐文章于 2026-02-17 00:25:49 发布

169

被折叠的 条评论
为什么被折叠?



