Commit 5644cfff by xiexiaoqin

scheduleList

parent a15b1efd
{ {
"component": true, "component": true,
"disableScroll": true, "allowsBounceVertical": "NO",
"usingComponents": { "usingComponents": {
"task-list": "../../components/taskList/taskList", "task-list": "../../components/taskList/taskList",
"file-list": "../../components/fileList/fileList", "file-list": "../../components/fileList/fileList",
......
...@@ -2,10 +2,284 @@ ...@@ -2,10 +2,284 @@
"requires": true, "requires": true,
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"ajv": {
"version": "6.12.0",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.0.tgz?cache=0&sync_timestamp=1582379551272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.0.tgz",
"integrity": "sha1-BtYLlth7hFSlrauobnhU2mKdtLc=",
"optional": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npm.taobao.org/asap/download/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"optional": true
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
"integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=",
"optional": true,
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"optional": true
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"optional": true
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
"optional": true
},
"aws4": {
"version": "1.9.1",
"resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.9.1.tgz",
"integrity": "sha1-fjPY99RJs/ZzzXLeuavcVS2+Uo4=",
"optional": true
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"optional": true,
"requires": {
"tweetnacl": "^0.14.3"
}
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"optional": true
},
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz",
"integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
"optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"optional": true
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0"
}
},
"dd-store": { "dd-store": {
"version": "1.8.3", "version": "1.8.4",
"resolved": "https://registry.npmjs.org/dd-store/-/dd-store-1.8.3.tgz", "resolved": "https://registry.npm.taobao.org/dd-store/download/dd-store-1.8.4.tgz",
"integrity": "sha512-++BcwtpK0m57fAvv4bl9lc5Fc23TQCmLVQYgaBG2fKh2eY6WXURr6gg7crhAWiwEfFKa2waRE+ei4HHSSerYSw==" "integrity": "sha1-ao5Y1Pis9gJZ9zV8rw1cbnTl+O8="
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"optional": true
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"optional": true,
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/errno/download/errno-0.1.7.tgz",
"integrity": "sha1-RoTXF3mtOa8Xfj8AeZb3xnyFJhg=",
"optional": true,
"requires": {
"prr": "~1.0.1"
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
"integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=",
"optional": true
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"optional": true
},
"fast-deep-equal": {
"version": "3.1.1",
"resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.1.tgz",
"integrity": "sha1-VFFFB3xQFJHjOxXsQIwpQ3bpSuQ=",
"optional": true
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz?cache=0&sync_timestamp=1576340291001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-json-stable-stringify%2Fdownload%2Ffast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=",
"optional": true
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
"optional": true
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz",
"integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=",
"optional": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0"
}
},
"graceful-fs": {
"version": "4.2.3",
"resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.3.tgz",
"integrity": "sha1-ShL/G2A3bvCYYsIJPt2Qgyi+hCM=",
"optional": true
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
"optional": true
},
"har-validator": {
"version": "5.1.3",
"resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.3.tgz",
"integrity": "sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=",
"optional": true,
"requires": {
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"image-size": {
"version": "0.5.5",
"resolved": "https://registry.npm.taobao.org/image-size/download/image-size-0.5.5.tgz",
"integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
"optional": true
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
"optional": true
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"optional": true
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
"optional": true
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
"optional": true
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz",
"integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=",
"optional": true
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
"optional": true
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"optional": true,
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"less": {
"version": "3.11.1",
"resolved": "https://registry.npm.taobao.org/less/download/less-3.11.1.tgz?cache=0&sync_timestamp=1581400737293&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fless%2Fdownload%2Fless-3.11.1.tgz",
"integrity": "sha1-xr8I454CQE/mswej3/+v3FW9NuI=",
"requires": {
"clone": "^2.1.2",
"errno": "^0.1.1",
"graceful-fs": "^4.1.2",
"image-size": "~0.5.0",
"mime": "^1.4.1",
"mkdirp": "^0.5.0",
"promise": "^7.1.1",
"request": "^2.83.0",
"source-map": "~0.6.0",
"tslib": "^1.10.0"
}
}, },
"luxon": { "luxon": {
"version": "1.22.2", "version": "1.22.2",
...@@ -13,6 +287,115 @@ ...@@ -13,6 +287,115 @@
"integrity": "sha512-vq6eSaOOw1fKob+JXwfu0e3/UFUT4G4HTFRJab7dch8J1OdOGW/vXqCiJsY7rm2In+5gKNYx0EtnYT0Tc5V4Qw==", "integrity": "sha512-vq6eSaOOw1fKob+JXwfu0e3/UFUT4G4HTFRJab7dch8J1OdOGW/vXqCiJsY7rm2In+5gKNYx0EtnYT0Tc5V4Qw==",
"optional": true "optional": true
}, },
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz",
"integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=",
"optional": true
},
"mime-db": {
"version": "1.43.0",
"resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.43.0.tgz?cache=0&sync_timestamp=1578281104943&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-db%2Fdownload%2Fmime-db-1.43.0.tgz",
"integrity": "sha1-ChLgUCZQ5HPXNVNQUOfI9OtPrlg=",
"optional": true
},
"mime-types": {
"version": "2.1.26",
"resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.26.tgz?cache=0&sync_timestamp=1578282585871&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.26.tgz",
"integrity": "sha1-nJIfwJt+FJpl39wNpNIJlyALCgY=",
"optional": true,
"requires": {
"mime-db": "1.43.0"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fminimist%2Fdownload%2Fminimist-1.2.5.tgz",
"integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=",
"optional": true
},
"mkdirp": {
"version": "0.5.5",
"resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.5.tgz",
"integrity": "sha1-2Rzv1i0UNsoPQWIOJRKI1CAJne8=",
"optional": true,
"requires": {
"minimist": "^1.2.5"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz",
"integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=",
"optional": true
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"optional": true
},
"promise": {
"version": "7.3.1",
"resolved": "https://registry.npm.taobao.org/promise/download/promise-7.3.1.tgz",
"integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=",
"optional": true,
"requires": {
"asap": "~2.0.3"
}
},
"prr": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/prr/download/prr-1.0.1.tgz",
"integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=",
"optional": true
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz",
"integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ=",
"optional": true
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=",
"optional": true
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
"integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=",
"optional": true
},
"request": {
"version": "2.88.2",
"resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz",
"integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=",
"optional": true,
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"rrule": { "rrule": {
"version": "2.6.4", "version": "2.6.4",
"resolved": "https://registry.npmjs.org/rrule/-/rrule-2.6.4.tgz", "resolved": "https://registry.npmjs.org/rrule/-/rrule-2.6.4.tgz",
...@@ -22,10 +405,96 @@ ...@@ -22,10 +405,96 @@
"tslib": "^1.10.0" "tslib": "^1.10.0"
} }
}, },
"safe-buffer": {
"version": "5.2.0",
"resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.0.tgz",
"integrity": "sha1-t02uxJsRSPiMZLaNSbHoFcHy9Rk=",
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz",
"integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=",
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz?cache=0&sync_timestamp=1571657176668&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsource-map%2Fdownload%2Fsource-map-0.6.1.tgz",
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
"optional": true
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz",
"integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=",
"optional": true,
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&sync_timestamp=1584646121003&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz",
"integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=",
"optional": true,
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tslib": { "tslib": {
"version": "1.11.1", "version": "1.11.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz",
"integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA=="
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"optional": true,
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz?cache=0&sync_timestamp=1581364203962&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftweetnacl%2Fdownload%2Ftweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
"optional": true
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
"integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=",
"optional": true,
"requires": {
"punycode": "^2.1.0"
}
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz",
"integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=",
"optional": true
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
} }
} }
} }
{ {
"dependencies": { "dependencies": {
"dd-store": "^1.8.4", "dd-store": "^1.8.4",
"less": "^3.11.1",
"rrule": "^2.6.4" "rrule": "^2.6.4"
} }
} }
import { RRule, RRuleSet, rrulestr } from "rrule";
import { padZero } from "../../utils/utils";
export function getDateMap(minYear, maxYear) {
const DateMap = new Map();
const getOneYear = (year) => {
const yearDays = (year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 366 : 365;
for (let i = 1; i <= yearDays; i++) {
DateMap.set(new Date(year, 0, i).toLocaleDateString(), []);
}
}
for (let i = minYear; i <= maxYear; i++) {
getOneYear(i);
}
return DateMap
}
// 返回删除的日期
/**
* 如果删除单次重复会议返回['2020-04-20'],
* 如果删除此次及以后重复会议返回['future2020-04-20']
*/
export function getExcludeDate(data = []) {
const excludeDateList = [];
const futureList = [];
data.forEach(item => {
//删除此次及以后
if (item.length > 10) {
futureList.push(new Date(item.slice(6, 16).replace(/-/g, "/")).getTime());
}
//删除单次
else {
excludeDateList.push(item);
}
});
return {
excludeDateList,
minFutureTime: Math.min(...futureList)
};
}
// 返回跨天数
export function getNextDateList(startTime, endTime) {
let days = 0;
const nextDateList = [];
if (startTime.getDate() !== endTime.getDate()) {
//同一个月
if (startTime.getMonth() !== endTime.getMonth()) {
days = endTime.getDate() - startTime.getDate();
}
//跨月
else {
// 一个月份有多少天new Date(year, month, 0).getDate()
const startMonth = new Date(startTime.getFullYear(), startTime.getMonth(), 0).getDate();
days = startMonth - startTime.getDate() + endTime.getDate()
}
} else {
//跨一个月 不考虑
}
//返回跨天的日期数组
for (let i = 1; i <= days; i++) {
const newDate = new Date(startTime);
const nextDate = new Date(newDate.setDate(newDate.getDate() + i)).toLocaleDateString();
nextDateList.push(nextDate)
}
return nextDateList
}
export function getWeekNumber(year, month, days) {
const isLeapYear = (year) => (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)
const getMonthDays = (year, month) => [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] || (isLeapYear(year) ? 29 : 28);
//那一天是那一年中的第多少天
for (var i = 0; i < month; i++) {
days += getMonthDays(year, i);
}
//那一年第一天是星期几
var yearFirstDay = new Date(year, 0, 1).getDay();
var week = null;
if (yearFirstDay == 0) {
week = Math.ceil(days / 7);
} else {
days -= (6 - yearFirstDay + 1);
week = Math.ceil(days / 7);
}
return week;
}
export function getBlankList(year) {
const dateMap = getDateMap(year, year);
const DateList = [];
dateMap.forEach(function (value, key) {
const keyDate = new Date(key);
const year = keyDate.getFullYear();
const month = keyDate.getMonth();
const date = keyDate.getDate();
const day = keyDate.getDay();
// 生成年
if (month === 0 && date === 1) {
DateList.push({
type: "year",
value: year,
dateStr: `${year}`
});
}
//生成月
if (date === 1) {
DateList.push({
type: "month",
value: month + 1,
dateStr: `${year}/${month + 1}`
});
}
//生成周
if (day === 0) {
const rangeDate = new Date(year, month, date + 6);
const rangeMonth2 = new Date(rangeDate).getMonth();
const rangeDay2 = new Date(rangeDate).getDate();
DateList.push({
type: "week",
value: `第${getWeekNumber(year, month, date)}周,${month + 1}${date}日 - ${
rangeMonth2 == month ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`,
dateStr: `${year}/${month + 1}/${date}-week`
});
}
})
return DateList;
}
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</view> </view>
</view> </view>
</view> </view>
<scroll-view class="indexScrollView" scroll-y="{{true}}" style="background: #FFFFFF" lower-threshold="100" onScrollToLower="lower" onScrollToUpper="upper" scroll-into-view="{{todayStr}}"> <scroll-view class="indexScrollView" scroll-y="{{true}}" style="background: #FFFFFF" lower-threshold="100" onScrollToLower="lower" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}" key="{{item.dateStr}}"> <block a:for="{{scheduleList}}" key="{{item.dateStr}}">
<!-- 年 --> <!-- 年 -->
<block a:if="{{item.type == 'year'}}"> <block a:if="{{item.type == 'year'}}">
......
import { RRule, RRuleSet, rrulestr } from "rrule"; import { RRule, RRuleSet, rrulestr } from "rrule";
import { getHomeUserSchedule1 } from "../../api/request"; import { getHomeUserSchedule1 } from "../../api/request";
import { getDateMap, getExcludeDate, getNextDateList, getWeekNumber, getBlankList } from './schedule.js';
import { import {
getFormatDate, getFormatDate,
getCurrentMonthFirst, throttle,
getCurrentMonthLast, padZero
throttle
} from "../../utils/utils"; } from "../../utils/utils";
const currentDate = new Date().toLocaleDateString(); const currentDate = new Date();
let minYear = 2019;
let maxYear = currentDate.getFullYear();
const DateMap = getDateMap(minYear, maxYear);
const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
import create from "dd-store"; import create from "dd-store";
create.Page({ create.Page({
data: { data: {
userMsg: "",
$data: null, $data: null,
response: "",
scheduleList: [], scheduleList: [],
todayStr: "", todayStr: "",
thisYear: "",
maxYear: "",
minYear: "",
pageStartTime: "",
pageEndTime: "",
show: false, show: false,
scrollHeight: "",
timeStamp: "",
userMsg: {}, userMsg: {},
loading: true loading: true
}, },
...@@ -47,10 +44,9 @@ create.Page({ ...@@ -47,10 +44,9 @@ create.Page({
this.scheduleList = []; this.scheduleList = [];
}, },
getPagination(scheduleList = []) { getPagination(scheduleList = []) {
this.scheduleList = scheduleList;
this.totalPages = Math.ceil(scheduleList.length / this.pageSize); this.totalPages = Math.ceil(scheduleList.length / this.pageSize);
for (let i = 0; i < scheduleList.length; i++) { for (let i = 0; i < scheduleList.length; i++) {
if (scheduleList[i].dateStr == currentDate) { if (scheduleList[i].dateStr == currentDate.toLocaleDateString()) {
this.firstPage = Math.floor(i / this.pageSize); this.firstPage = Math.floor(i / this.pageSize);
this.currentPage = this.firstPage + 1; this.currentPage = this.firstPage + 1;
break break
...@@ -58,40 +54,17 @@ create.Page({ ...@@ -58,40 +54,17 @@ create.Page({
} }
}, },
getDate: throttle(function (e) { getDate: throttle(function (e) {
let data = { getHomeUserSchedule1({
startTime: "2020-01-01 00:00:00", startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59" endTime: "2025-12-30 23:59:59"
}; }).then(res => {
let that = this;
getHomeUserSchedule1(data).then(res => {
that.setData(
{
response: res.data.data
},
() => {
let now = new Date();
let year = now.getFullYear();
let scheduleList = [];
for (let i = 0; i <= year - 2000; i++) {
scheduleList.push.apply(
scheduleList,
that.returnScheduleList(2000 + i)
);
}
this.getPagination(scheduleList);
this.scheduleList = this.getScheduleList(res.data.data)
this.getPagination(this.scheduleList);
// 第一次加载 // 第一次加载
console.log(scheduleList); this.setData({
that.setData({ scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize),
scheduleList: scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize), todayStr: currentDate.toLocaleDateString(),
todayStr: currentDate,
thisYear: year,
maxYear: year
});
console.log(this.data.scheduleList)
}
);
that.setData({
loading: false loading: false
}); });
}); });
...@@ -117,264 +90,151 @@ create.Page({ ...@@ -117,264 +90,151 @@ create.Page({
preventSort() { preventSort() {
return false; return false;
}, },
// 返回删除的日期
returnExcludeDate(data) { //生成DateMap值
let returnData = { setDateMapValue(startTime, endTime, item) {
scheduleList: [], const pushItem = {
templateList: [] endTime: endTime,
startTime: startTime,
planDate: getFormatDate(startTime, "yyyyMMdd", "-"),
thisDayStartTime: getFormatDate(startTime, 'HH:mm'),
thisDayEndTime: getFormatDate(endTime, 'HH:mm'),
scheduleTemplateId: item.id,
confirmAttendance: item.confirmAttendance,
title: item.title,
}; };
data.map(item => { if (DateMap.has(startTime.toLocaleDateString())) {
if (item.length > 10) { DateMap.get(startTime.toLocaleDateString()).push(pushItem)
returnData.templateList.push(
new Date(item.slice(6, 16).replace(/-/g, "/")).getTime()
);
} else {
returnData.scheduleList.push(item);
} }
// 如果是跨天会议,需要手动在今天以后的其他天 添加会议日程
const nextDateList = getNextDateList(startTime, endTime);
if (nextDateList.length > 0) {
for (let i = 0; i < nextDateList.length; i++) {
if (DateMap.has(nextDateList[i])) {
DateMap.get(nextDateList[i]).push({
...pushItem,
isDaySpan: true,
isfirstDayOrEndDay: i === 0 ? "0" : i === nextDateList.length ? "2" : "1", // 0 第一天,1中间的天,2结束的天
isFewDays: i + 1,
duration: nextDateList.length + 1,
isBeOverdue: currentDate.getTime() > endTime.getTime() ? true : false
}); });
return { }
scheduleList: returnData.scheduleList, }
templateList: Math.min(...returnData.templateList) }
};
}, },
// 生成用户时间段内的会议日程并返回会议日程List // 根据接口返回数据生成填充DateMap
getCalendarList() { setDateMapByResponse(response) {
let that = this; if (response) {
// 定义map数据结构 const repeatIdList = []; //重复会议的ID
let scheduleMap = new Map(); // 处理重复会议 templateList
// 对规则内的 response.templateList.forEach(item => {
if (this.data.response) { repeatIdList.push(item.id)
this.data.response.templateList.map(item => { // 生成rrules规则
// TO DO 判断所获取的时间区间 const initialTimeList = item.initialTime.split('-');
// 将会议的年,月,日拆分,时分拆分,生成rrules规则 const startTimeList = item.startTime.split(":");
let initialTime = item.initialTime.split("-"); const DTSTART = `${initialTimeList[0]}${initialTimeList[1]}${initialTimeList[2]}T${startTimeList[0]}${startTimeList[1]}00Z`;
let initialTimeDate = new Date( const rule = RRule.fromString(
parseInt(initialTime[0]),
parseInt(initialTime[1]) - 1,
parseInt(initialTime[2])
);
let initialTimeDateyear = initialTimeDate.getFullYear();
let initialTimeDatemonth =
initialTimeDate.getMonth() + 1 < 10
? "0" + (initialTimeDate.getMonth() + 1)
: initialTimeDate.getMonth() + 1;
let initialTimeDateday =
initialTimeDate.getDate() < 10
? "0" + initialTimeDate.getDate()
: initialTimeDate.getDate();
let startTimeList = item.startTime.split(":");
let DTSTART = `${initialTimeDateyear}${initialTimeDatemonth}${initialTimeDateday}T${startTimeList[0]}${startTimeList[1]}00Z`;
let rule = RRule.fromString(
`${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}` `${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}`
); );
// rule.options.tzid = ""; // 需要剔除某一天
// 判断是否需要剔除某一天
if (item.excludePlanDates) { if (item.excludePlanDates) {
// 拿到剔除日期的list const excludeData = getExcludeDate(item.excludePlanDates.split(","));
let excludeDateList = that.returnExcludeDate( rule.all().forEach(startTime => {
item.excludePlanDates.split(",") //修正时间(时间有8小时时差)
); startTime.setHours(startTime.getHours() - 8);
rule.all().map(item2 => { // 生成结束时间
let time = new Date(item2); const endTime = new Date(startTime);
time.setHours(time.getHours() - 8); endTime.setMinutes(endTime.getMinutes() + item.recurrenceModel.duration);
let hasExclude = // 剔除规则
excludeDateList.scheduleList.indexOf(excludeDate) === -1; if (startTime.getTime() < excludeData.minFutureTime &&
let excludeDate = getFormatDate(time, "yyyyMMdd", "-"); excludeData.excludeDateList.indexOf(getFormatDate(startTime, "yyyyMMdd", "-")) === -1) {
if ( this.setDateMapValue(startTime, endTime, item);
new Date(time).getTime() < excludeDateList.templateList &&
hasExclude
) {
let startTime =
getFormatDate(time, "yyyyMMdd") +
" " +
item.recurrenceModel.startTime;
let endTime = new Date(
getFormatDate(time, "yyyyMMdd") +
" " +
item.recurrenceModel.startTime
);
endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration
);
scheduleMap.set(
`${new Date(time).toLocaleDateString()}/${item.id}`,
{
confirmAttendance: item.confirmAttendance,
endTime: getFormatDate(endTime, "yyyyMMdd HH:mm:ss"),
scheduleTemplateId: item.id,
startTime: startTime,
title: item.title,
planDate: getFormatDate(time, "yyyyMMdd", "-")
}
);
} }
}); });
} else {
rule.all().map(item2 => {
let time = new Date(item2);
time.setHours(time.getHours() - 8);
let startTime =
getFormatDate(time, "yyyyMMdd") +
" " +
item.recurrenceModel.startTime;
let endTime = new Date(
getFormatDate(time, "yyyyMMdd") +
" " +
item.recurrenceModel.startTime
);
endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration
);
scheduleMap.set(
`${new Date(time).toLocaleDateString()}/${item.id}`,
{
confirmAttendance: item.confirmAttendance,
endTime: getFormatDate(endTime, "yyyyMMdd HH:mm:ss"),
scheduleTemplateId: item.id,
startTime: startTime,
title: item.title,
planDate: getFormatDate(time, "yyyyMMdd", "-")
} }
); // 正常生成数据
else {
rule.all().forEach(startTime => {
//修正时间(时间有8小时时差)
startTime.setHours(startTime.getHours() - 8);
// 生成结束时间
const endTime = new Date(startTime);
endTime.setMinutes(endTime.getMinutes() + item.recurrenceModel.duration);
this.setDateMapValue(startTime, endTime, item);
}); });
} }
}); });
let scheduleList = [];
this.data.response.scheduleList.map(item => { // 处理单次会议 scheduleList
response.scheduleList.forEach(item => {
if (!item.scheduleTemplateId) { if (!item.scheduleTemplateId) {
scheduleList.push(item); this.setDateMapValue(new Date(item.startTime.replace(/-/g, '/')), new Date(item.endTime.replace(/-/g, '/')), item);
} else if (
item.scheduleTemplateId &&
scheduleMap.get(
`${new Date(
item.planDate.replace(/-/g, "/")
).toLocaleDateString()}/${item.scheduleTemplateId}`
)
) {
scheduleMap.set(
`${new Date(
item.planDate.replace(/-/g, "/")
).toLocaleDateString()}/${item.scheduleTemplateId}`,
item
);
}
});
scheduleMap.forEach(function (value, key, map) {
scheduleList.push(value);
});
return scheduleList;
} else {
return [];
}
},
returnScheduleList(year) {
let that = this;
let weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
let DateMap = new Map();
// 平年或闰年
let isLeapYear =
(year % 4 == 0 && year % 100 != 0) || year % 400 == 0 ? 366 : 365;
let isFirstWeek = false;
for (let i = 1; i <= isLeapYear; i++) {
// 判断一月第一周的第一个周日
if (i <= 7 && new Date(year, 0, i).getDay() === 0) {
isFirstWeek = true;
}
` `;
// 是第一个月第一个周一
if (isFirstWeek) {
DateMap.set(`${new Date(year, 0, i).toLocaleDateString()}`, {
scheduleList: []
});
} }
// 有scheduleTemplateId则是虚拟会议转成实体会议,需要替换rrule生成的会议记录
else if (repeatIdList.includes(item.scheduleTemplateId)) {
const list = DateMap.get(new Date(item.planDate.replace(/-/g, '/')).toLocaleDateString()) || [];
list.forEach((o, index) => {
if (o.scheduleTemplateId == item.scheduleTemplateId) {
list.splice(index, 1)
} }
// 跨年的那几天不是周日
let num =
new Date(year, 0, isLeapYear).getDay() === 6
? 0
: 6 - new Date(year, 0, isLeapYear).getDay();
for (let i = 0; i <= num; i++) {
DateMap.set(`${new Date(year, 0, isLeapYear + i).toLocaleDateString()}`, {
scheduleList: []
}); });
this.setDateMapValue(new Date(item.startTime.replace(/-/g, '/')), new Date(item.endTime.replace(/-/g, '/')), item);
} }
let AllScheduleList = this.getCalendarList();
// 遍历所有日程
for (let y = 0; y < AllScheduleList.length; y++) {
let date1 = AllScheduleList[y].startTime.slice(0, 10).replace(/-/g, "/");
let date2 = AllScheduleList[y].endTime.slice(0, 10).replace(/-/g, "/");
let count = this.count(date1, date2);
for (let j = 0; j <= count; j++) {
let time = new Date(date1);
time.setDate(time.getDate() + j);
let keyDate = time.toLocaleDateString();
if (DateMap.get(keyDate)) {
DateMap.get(keyDate).scheduleList.push({
...AllScheduleList[y],
isDaySpan: count == 0 ? false : true,
isfirstDayOrEndDay: j === 0 ? "0" : j === count ? "2" : "1", // 0 第一天,1中间的天,2结束的天
thisDayStartTime: AllScheduleList[y].startTime.slice(11, 16),
thisDayEndTime: AllScheduleList[y].endTime.slice(11, 16),
isFewDays: j + 1,
duration: count + 1,
isBeOverdue:
new Date().getTime() >
new Date(AllScheduleList[y].endTime.replace(/-/g, "/")).getTime()
? true
: false
}); });
} }
} },
}
let DateList = []; //日程数据
let listMonth = ""; getScheduleList(response) {
// 第一个月的第一天 this.setDateMapByResponse(response);
let listWeek = new Date(year, 0, 1).getDay() === 0 ? 1 : 2; // 取出DateMap的value值平铺到DateList
let thisDay = new Date().toLocaleDateString(); const DateList = [];
DateMap.forEach(function (value, key, map) { DateMap.forEach(function (value, key) {
const keyDate = new Date(key); const keyDate = new Date(key);
if (keyDate.getMonth() === 0 && keyDate.getDate() === 1) { const year = keyDate.getFullYear();
const month = keyDate.getMonth();
const date = keyDate.getDate();
const day = keyDate.getDay();
// 生成年
if (month === 0 && date === 1) {
DateList.push({ DateList.push({
type: "year", type: "year",
value: keyDate.getFullYear(), value: year,
dateStr: `${keyDate.getFullYear()}` dateStr: `${year}`
}); });
} }
if (keyDate.getDate() === 1) { //生成月
if (date === 1) {
DateList.push({ DateList.push({
type: "month", type: "month",
value: keyDate.getMonth() + 1, value: month + 1,
dateStr: `${keyDate.getFullYear()}/${keyDate.getMonth() + 1}` dateStr: `${year}/${month + 1}`
}); });
} }
if (keyDate.getDay() === 0) { //生成周
let rangeYear1 = keyDate.getFullYear(); if (day === 0) {
let rangeMonth1 = keyDate.getMonth(); const rangeDate = new Date(year, month, date + 6);
let rangeDay1 = keyDate.getDate(); const rangeMonth2 = new Date(rangeDate).getMonth();
let rangeDate = new Date(rangeYear1, rangeMonth1, rangeDay1 + 6); const rangeDay2 = new Date(rangeDate).getDate();
let rangeMonth2 = new Date(rangeDate).getMonth();
let rangeDay2 = new Date(rangeDate).getDate();
DateList.push({ DateList.push({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${getWeekNumber(year, month, date)}周,${month + 1}${date}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == month ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dateStr: `${keyDate.getFullYear()}/${rangeMonth1 + dateStr: `${year}/${month + 1}/${date}-week`
1}/${rangeDay1}-week`
}); });
listWeek += 1;
} }
// 有日程长度 并且不是今天 // 有日程长度
if (value.scheduleList.length !== 0 && key !== thisDay) { if (value.length !== 0) {
value.scheduleList.map((item, index) => { value.forEach((item, index) => {
if (index === 0) { if (index === 0) {
DateList.push({ DateList.push({
type: "day", type: key !== currentDate.toLocaleDateString() ? "day" : 'today',
week: weekList[keyDate.getDay()], week: weekList[day],
hasDateLabel: hasDateLabel: padZero(date),
keyDate.getDate() < 10
? "0" + keyDate.getDate()
: keyDate.getDate(),
value: item, value: item,
dateStr: `${key}` dateStr: `${key}`
}); });
...@@ -386,89 +246,60 @@ create.Page({ ...@@ -386,89 +246,60 @@ create.Page({
}); });
} }
}); });
} } else if (value.length === 0 && key === currentDate.toLocaleDateString()) {
// 有日程长度,并且是今天
else if (value.scheduleList.length !== 0 && key === thisDay) {
value.scheduleList.map((item, index) => {
if (index === 0) {
DateList.push({
type: "today",
week: weekList[keyDate.getDay()],
hasDateLabel:
keyDate.getDate() < 10
? "0" + keyDate.getDate()
: keyDate.getDate(),
value: item,
dateStr: `${key}`
});
} else {
DateList.push({
type: "today",
value: item,
dateStr: `${key}/${item.id || item.scheduleTemplateId}`
});
}
});
}
if (value.scheduleList.length === 0 && key === thisDay) {
DateList.push({ DateList.push({
type: "thisDay", type: "thisDay",
value: "", value: "",
hasDateLabel: hasDateLabel: padZero(date),
keyDate.getDate() < 10 week: weekList[day],
? "0" + keyDate.getDate()
: keyDate.getDate(),
week: weekList[keyDate.getDay()],
dateStr: key dateStr: key
}); });
} }
}); });
return DateList; return DateList;
}, },
// 是否跨天 返回跨天数
count(date1, date2) {
var date1 = new Date(date1);
var date2 = new Date(date2);
var date =
(date2.getTime() - date1.getTime()) /
(1000 * 60 * 60 * 24); /*不用考虑闰年否*/
return date;
},
lower() { lower() {
// let year = this.data.maxYear + 1;
// let DateList = this.returnScheduleList(year);
// let scheduleList = this.data.scheduleList;
// scheduleList.push.apply(DateList);
// this.setData({
// scheduleList,
// maxYear: year
// });
if (this.currentPage < this.totalPages) { if (this.currentPage < this.totalPages) {
this.currentPage++; this.currentPage++;
this.setData({ this.setData({
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize) scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize)
}); });
console.log(this.data.scheduleList) } else {
maxYear++;
this.data.scheduleList.push(...getBlankList(maxYear));
this.setData({
scheduleList: this.data.scheduleList
})
} }
}, },
upper: throttle(function () { onPullDownRefresh() {
console.log(this.firstPage);
if (this.firstPage > 0) { if (this.firstPage > 0) {
this.firstPage--; this.firstPage--;
this.setData({ this.setData({
todayStr: '',
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize) scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize)
}, () => {
this.setData({
todayStr: this.scheduleList[(this.firstPage + 1) * this.pageSize].dateStr
}); });
dd.stopPullDownRefresh()
});
} else {
minYear--;
this.data.scheduleList.unshift(...getBlankList(minYear));
this.setData({ this.setData({
todayStr: '' todayStr: '',
scheduleList: this.data.scheduleList
}, () => { }, () => {
this.setData({ this.setData({
todayStr: this.scheduleList[(this.firstPage + 1) * this.pageSize - (this.pageSize / 2)].dateStr // 我已经算不清楚了
}) // todayStr: this.data.scheduleList[(2019 - minYear) * 76].dateStr
});
dd.stopPullDownRefresh()
}) })
console.log(this.scheduleList[this.firstPage * this.pageSize - (this.pageSize / 2)].dateStr)
console.log(this.data.scheduleList)
} }
}), },
nextPage() { nextPage() {
dd.navigateTo({ url: "./../createMeeting/createMeeting" }); dd.navigateTo({ url: "./../createMeeting/createMeeting" });
}, },
...@@ -479,7 +310,7 @@ create.Page({ ...@@ -479,7 +310,7 @@ create.Page({
}, },
() => { () => {
this.setData({ this.setData({
todayStr: new Date().toLocaleDateString() todayStr: currentDate.toLocaleDateString()
}); });
this.$store.data.isLocation = false; this.$store.data.isLocation = false;
this.update(); this.update();
......
{ {
"allowsBounceVertical": "YES",
"pullRefresh": true,
"usingComponents": { "usingComponents": {
"popup": "../../components/popup/index" "popup": "../../components/popup/index"
} }
......
...@@ -51,6 +51,8 @@ export function getFormatDate(time, format, symbol) { ...@@ -51,6 +51,8 @@ export function getFormatDate(time, format, symbol) {
: `${year}/${month}/${day}`; : `${year}/${month}/${day}`;
} else if (format === "HH:mm:ss") { } else if (format === "HH:mm:ss") {
return `${hour}:${minutes}:${seconds}`; return `${hour}:${minutes}:${seconds}`;
} else if (format === "HH:mm") {
return `${hour}:${minutes}`;
} }
} }
// 返回每个月的第一天 // 返回每个月的第一天
...@@ -142,3 +144,7 @@ export function getCreateShowTime(createdTime) { ...@@ -142,3 +144,7 @@ export function getCreateShowTime(createdTime) {
return timeResule return timeResule
} }
export function padZero(val) {
return ("00" + val).slice(-2);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment