New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zzc-design-mobile

Package Overview
Dependencies
Maintainers
4
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zzc-design-mobile - npm Package Compare versions

Comparing version 3.7.3 to 3.7.4

14

lib/Calendar/components/Calendar.js

@@ -139,6 +139,7 @@ 'use strict';

var _endTime = props.endTime ? _this.conversionSelectTime(props.endTime, props.defaultEndTime) : null;
var rangeInViewDate = _this.getRangeInViewDate(props.rangeInView);
// 与外部传入i18n进行合并
var i18n = props.i18n ? (0, _assign2.default)((0, _i18n2.default)(props.lang), props.i18n) : (0, _i18n2.default)(props.lang);
var _createCalendarMap = (0, _createCalendarMap3.default)(props.lang, props.dropOffMaxDays, props.dateExtension, _startTime, _endTime, props.yesterday, i18n),
var _createCalendarMap = (0, _createCalendarMap3.default)(props.lang, props.dropOffMaxDays, props.dateExtension, _startTime, _endTime, props.yesterday, i18n, rangeInViewDate),
startIndexInfo = _createCalendarMap.startIndexInfo,

@@ -163,3 +164,4 @@ endIndexInfo = _createCalendarMap.endIndexInfo,

_calendar_tips: '',
_listBoxPaddingBottom: 30
_listBoxPaddingBottom: 30,
rangeInViewDate: rangeInViewDate
};

@@ -176,2 +178,10 @@ _this.selectItem = _this.selectItem.bind(_this);

(0, _createClass3.default)(Calendar, [{
key: 'getRangeInViewDate',
value: function getRangeInViewDate(rangeInView) {
return {
start: rangeInView && rangeInView[0] ? new Date(rangeInView[0]) : null,
end: rangeInView && rangeInView[1] ? new Date(rangeInView[1]) : null
};
}
}, {
key: 'conversionSelectTime',

@@ -178,0 +188,0 @@ value: function conversionSelectTime(time, hours) {

88

lib/Calendar/util/createCalendarMap.js

@@ -15,21 +15,22 @@ 'use strict';

function createCalendarMap(lang, dropOffMaxDays, dateExtension, startInfo, endInfo, yesterday, i18n) {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth();
function createCalendarMap(lang, dropOffMaxDays, dateExtension, startInfo, endInfo, yesterday, i18n, rangeInViewDate) {
var now = new Date();
var startDateInView = rangeInViewDate.start && rangeInViewDate.start > now ? rangeInViewDate.start : new Date(now);
var endDateInView = rangeInViewDate.end;
var year = startDateInView.getFullYear();
var month = startDateInView.getMonth();
var calendarMap = [];
// 今天
var nowMonth = now.getMonth();
var nowYear = now.getFullYear();
var nowDay = now.getDate();
var lastDateMap = dropOffMaxDays > 0 ? _getLastDateMap(Number(dropOffMaxDays)) : null;
// const nowMonth = now.getMonth();
// const nowYear = now.getFullYear();
// const nowDay = now.getDate();
var lastDateMap = _getLastDateMap(Number(dropOffMaxDays), startDateInView, endDateInView);
var startIndexInfo = null;
var endIndexInfo = null;
var step = 13;
var step = getStep(startDateInView, endDateInView);
for (var i = 0; i < step; i++) {
var _createMonthMap2 = _createMonthMap({
n_y: nowYear,
n_m: nowMonth,
n_d: nowDay
n_y: startDateInView.getFullYear(),
n_m: startDateInView.getMonth(),
n_d: startDateInView.getDate()
}, lastDateMap, year, month, lang, dateExtension, startInfo, endInfo, startIndexInfo, endIndexInfo, yesterday, i18n),

@@ -61,14 +62,45 @@ monthData = _createMonthMap2.monthData,

}
function _getLastDateMap(AddDayCount) {
var last = new Date();
last.setDate(last.getDate() + AddDayCount);
var lastYear = last.getFullYear();
var lastMonth = last.getMonth();
var lastDay = last.getDate();
function getStep(start, end) {
if (end) {
var s_y = start.getFullYear();
var s_m = start.getMonth();
var e_m = end.getMonth();
var e_y = end.getFullYear();
return e_m + (e_y - s_y) * 12 - s_m + 1;
}
return 13; // 12 + 1
}
function getDateInfo(date) {
return {
l_y: lastYear,
l_m: lastMonth,
l_d: lastDay
Y: date.getFullYear(),
M: date.getMonth(),
D: date.getDate()
};
}
function _getLastDateMap(AddDayCount, startDateInView, endDateInView) {
function getEndDateInfo(endDateInView) {
var info = getDateInfo(endDateInView);
return {
l_y: info.Y,
l_m: info.M,
l_d: info.D
};
}
if (AddDayCount > 0) {
var last = new Date(startDateInView);
last.setDate(last.getDate() + AddDayCount);
var lastYear = last.getFullYear();
var lastMonth = last.getMonth();
var lastDay = last.getDate();
if (endDateInView && endDateInView < last) {
return getEndDateInfo(endDateInView);
}
return {
l_y: lastYear,
l_m: lastMonth,
l_d: lastDay
};
}
return endDateInView ? getEndDateInfo(endDateInView) : null;
}
function _createMonthMap(now, lastDateMap, year, month, lang, dateExtension, startInfo, endInfo, startIndexInfo, endIndexInfo, yesterday, i18n) {

@@ -92,2 +124,8 @@ var startDay = 0;

var rowList = [];
var nowToday = getDateInfo(new Date());
var nowTodayInfo = {
n_y: nowToday.Y,
n_m: nowToday.M,
n_d: nowToday.D
};
// 第一天补位,如果不是星期1,那么将需要补位

@@ -105,3 +143,3 @@ rowList = _setStartEmptyItem(year, month, startDay + 1);

gone: false,
sub: _createDayInfoSubText((0, _assign2.default)({}, now, { c_y: year, c_m: month, c_d: currData }), i18n)
sub: _createDayInfoSubText((0, _assign2.default)({}, nowTodayInfo, { c_y: year, c_m: month, c_d: currData }), i18n)
}, dateExtension));

@@ -114,3 +152,3 @@ } else {

gone: yesterday && year == now.n_y && month == now.n_m && currData == now.n_d - 1 ? false : true,
sub: _createDayInfoSubText((0, _assign2.default)({}, now, { c_y: year, c_m: month, c_d: currData }), i18n)
sub: _createDayInfoSubText((0, _assign2.default)({}, nowTodayInfo, { c_y: year, c_m: month, c_d: currData }), i18n)
}, dateExtension));

@@ -126,3 +164,3 @@ }

gone: yesterday && year == now.n_y && month == now.n_m && currData == now.n_d - 1 ? false : true,
sub: _createDayInfoSubText((0, _assign2.default)({}, now, { c_y: year, c_m: month, c_d: currData }), i18n)
sub: _createDayInfoSubText((0, _assign2.default)({}, nowTodayInfo, { c_y: year, c_m: month, c_d: currData }), i18n)
}, dateExtension));

@@ -135,3 +173,3 @@ } else {

gone: false,
sub: _createDayInfoSubText((0, _assign2.default)({}, now, { c_y: year, c_m: month, c_d: currData }), i18n)
sub: _createDayInfoSubText((0, _assign2.default)({}, nowTodayInfo, { c_y: year, c_m: month, c_d: currData }), i18n)
}, dateExtension));

@@ -138,0 +176,0 @@ }

{
"name": "zzc-design-mobile",
"name_cn": "租租车主流程UI规范",
"version": "3.7.3",
"version": "3.7.4",
"description": "",

@@ -6,0 +6,0 @@ "main": "./lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc