MCPcopy Create free account
hub / github.com/TributePaulWalker/Profiles / dateDiff

Function dateDiff

JavaScript/Surge/Timecard.js:46–55  ·  view source on GitHub ↗
(startDateString, endDateString)

Source from the content-addressed store, hash-verified

44 * @returns
45 */
46function dateDiff(startDateString, endDateString) {
47 var separator = "-"; //日期分隔符
48 var startDates = startDateString.split(separator);
49 var endDates = endDateString.split(separator);
50 var startDate = new Date(startDates[0], startDates[1] - 1, startDates[2]);
51 var endDate = new Date(endDates[0], endDates[1] - 1, endDates[2]);
52 return parseInt(
53 (endDate - startDate) / 1000 / 60 / 60 / 24
54 ).toString();
55}
56
57//计算输入序号对应的时间与现在的天数间隔
58function tnumcount(num) {

Callers 3

Timecard.jsFile · 0.85
tnumcountFunction · 0.85
nowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected