Commit 2b0826ba by xiexiaoqin

0点不算跨天会议,跨天会议排序

parent 23c8a1a4
......@@ -23,9 +23,9 @@ App({
userid: "",
name: "",
userInfo: "",
// globalUrl: "https://gateway-beta.mingwork.com", //beta地址
// globalUrl2: "https://third-authentication-beta.mingwork.com"
globalUrl: "https://gateway2.mingwork.com", // 线上地址
globalUrl2: "https://third-authentication.mingwork.com" //线上地址
globalUrl: "https://gateway-beta.mingwork.com", //beta地址
globalUrl2: "https://third-authentication-beta.mingwork.com"
// globalUrl: "https://gateway2.mingwork.com", // 线上地址
// globalUrl2: "https://third-authentication.mingwork.com" //线上地址
}
});
......@@ -92,7 +92,7 @@
<view class="scheduleTime">
<text a:if="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '0'}}">{{item.value.thisDayStartTime}}</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '1'}}">全天</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '2'}}">直到{{item.value.thisDayEndTime}}</text>
<text a:elif="{{item.value.isDaySpan && item.value.isfirstDayOrEndDay === '2'}}">{{ item.value.thisDayEndTime == '00:00' ? '全天' : '直到'+item.value.thisDayEndTime }}</text>
<text a:else>{{item.value.thisDayStartTime}} - {{item.value.thisDayEndTime}}</text>
</view>
</view>
......
......@@ -89,7 +89,7 @@ create.Page({
this.setData({
listLoading: false
});
let scheduleItem = JSON.parse(Object.keys(event)[0].split("=")[1]);
const scheduleItem = JSON.parse(Object.keys(event)[0].split("=")[1]);
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(scheduleItem)
......@@ -322,7 +322,7 @@ create.Page({
pushItem.duration = nextDateList.length;
for (let i = 1; i < nextDateList.length; i++) {
if (DateMap.has(nextDateList[i])) {
DateMap.get(nextDateList[i]).unshift({
DateMap.get(nextDateList[i]).push({
...pushItem,
isFewDays: i + 1,
isfirstDayOrEndDay: nextDateList.length - 1 === i ? "2" : "1" // 0 第一天,1中间的天,2结束的天
......
......@@ -36,24 +36,20 @@ export function getExcludeDate(data = []) {
};
}
// 返回跨天数
// 返回跨天数
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 {
//跨一个月 不考虑
//去掉时分
const firstDate = new Date(startTime.toLocaleDateString());
const secondDate = new Date(endTime.toLocaleDateString());
days = parseInt(Math.abs(firstDate.getTime() - secondDate.getTime()) / (1000 * 60 * 60 * 24));
if (endTime.getHours() == 0 && endTime.getMinutes() == 0) {
days -= 1;
}
//返回跨天的日期数组
for (let i = 0; i <= days; i++) {
const newDate = new Date(startTime);
......
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