Authored by 张文文

Merge branch 'V1130_Date' of http://git.yoho.cn/mobile/YH_RNComponent into group_v1130

... ... @@ -475,6 +475,7 @@ const ScrollView = createReactClass({
pull to refresh
*/
enablePullToRefresh: PropTypes.bool,
enableUFOPullToRefresh: PropTypes.bool,
isOnPullToRefresh: PropTypes.bool,
onRefreshData: PropTypes.func,
onFinishRefreshData: PropTypes.func,
... ...
... ... @@ -333,6 +333,7 @@ const ScrollView = React.createClass({
pull to refresh
*/
enablePullToRefresh: PropTypes.bool,
enableUFOPullToRefresh: PropTypes.bool,
isOnPullToRefresh: PropTypes.bool,
onRefreshData: PropTypes.func,
onFinishRefreshData: PropTypes.func,
... ...
... ... @@ -448,7 +448,7 @@ function parseActivityTimeLsit(json, focusTime=0) {
}
}
let now = Date.now();
let now = new Date();
newActivityTimeList.forEach((activityTimeItem, i) => {
let date,
... ... @@ -466,13 +466,9 @@ function parseActivityTimeLsit(json, focusTime=0) {
activityTimeItem.specialState = 0;
let startDays = Math.floor(now / 1000 / 60 / 60 / 24);
let endDate = Math.floor(activityTimeItem.startTime / 1000 / 60 / 60 / 24);
let offsetDate = endDate - startDays;
let offsetDate = getDiffDays(date, now);
activityTimeItem.specialState = offsetDate < 0 ? 0 : offsetDate;
if (currentTime > activityTimeItem.startTime) {
if(currentTime > activityTimeItem.endTime){
... ... @@ -516,3 +512,14 @@ function parseActivityTimeLsit(json, focusTime=0) {
};
}
//date1 减去 date2 相差的天数
function getDiffDays(date1, date2){
let nDate1 = new Date();
nDate1 = new Date(date1.getFullYear(),date1.getMonth(),date1.getDate());
let newDate2 = new Date(date2);
newDate2 =new Date(date2.getFullYear(),date2.getMonth(),date2.getDate());
let diffDays = (nDate1 - newDate2) / 1000 / 60 / 60 / 24;
return diffDays;
}
... ...