Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Objective目的:
To calculate the duration between 2 given dates
计算两个给定日期之间的持续时间
截图Screenshot:
Code代码:
Code Block | ||
---|---|---|
| ||
$('input[name="fromDatepicker"], input[name="toDatepicker"]').change( function(){ d1 = $('input[name="fromDatepicker"]').datepicker('getDate'); d2 = $('input[name="toDatepicker"]').datepicker('getDate'); diff = 0; if (d1 && d2) { diff = Math.floor((d2.getTime() - d1.getTime()) / 86400000); // ms per day } $('input[name=days]').val(diff); }); |
Sample App Download示例应用下载
View file name APP_calculateDateDiff-1-20160404092232.zip height 250