sbd-npm 1.1.57 → 1.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +1 -0
- package/menu.js +1 -0
- package/package.json +1 -1
- package/util.js +18 -5
package/.npmignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
sbd-npm.md
|
package/menu.js
CHANGED
@@ -191,6 +191,7 @@ const MenuList = [
|
|
191
191
|
{'key': 'snowball_user', 'name': '用户列表', 'url': '/97339b8453883dd27e6087ae7db6f62a'},
|
192
192
|
{'key': 'snowball_tool', 'name': '搜索工具', 'url': '/ac88ee85f27e11aa06f2b8f46b03a0eb'},
|
193
193
|
{'key': 'snowball_red_packet', 'name': '红包数据', 'url': '/23d88182f12431fe67f658b725cbaf1d'},
|
194
|
+
{'key': 'snowball_tweet', 'name': '推文', 'url': '/9a9aef7fced3f15ff7647de75d70798c'},
|
194
195
|
]
|
195
196
|
},
|
196
197
|
{
|
package/package.json
CHANGED
package/util.js
CHANGED
@@ -502,8 +502,12 @@ const Util = {
|
|
502
502
|
*/
|
503
503
|
is_trade_time: function () {
|
504
504
|
let date = new Date();
|
505
|
-
let
|
506
|
-
|
505
|
+
let weekday = date.getDay();
|
506
|
+
if (weekday > 0 && weekday < 6) {
|
507
|
+
let hour = date.getHours();
|
508
|
+
return hour >= 9 && hour < 15 && hour !== 12;
|
509
|
+
}
|
510
|
+
return false;
|
507
511
|
},
|
508
512
|
|
509
513
|
/**
|
@@ -1168,6 +1172,17 @@ const Util = {
|
|
1168
1172
|
return parseInt(seconds_to_format(seconds, "%Y"));
|
1169
1173
|
},
|
1170
1174
|
|
1175
|
+
/**
|
1176
|
+
* 一周的哪一天(1-7,星期一:1,星期二:2,...星期日:7)
|
1177
|
+
* @returns {*|number}
|
1178
|
+
*/
|
1179
|
+
get_weekday: function() {
|
1180
|
+
let date = new Date();
|
1181
|
+
let weekday = date.getDay();
|
1182
|
+
weekday = weekday > 0 ? weekday : 7; // 星期天是0
|
1183
|
+
return weekday;
|
1184
|
+
},
|
1185
|
+
|
1171
1186
|
/**
|
1172
1187
|
* 获取 cookie 的值(X-CSRFToken Cross-Site Request Forgery Token)
|
1173
1188
|
* @param name
|
@@ -1288,9 +1303,7 @@ const Util = {
|
|
1288
1303
|
let ed_obj = $('#' + end_id);
|
1289
1304
|
sd_obj.attr("disabled", false);
|
1290
1305
|
ed_obj.attr("disabled", false);
|
1291
|
-
let
|
1292
|
-
let weekday = date.getDay();
|
1293
|
-
weekday = weekday > 0 ? weekday : 7; // 星期天是0
|
1306
|
+
let weekday = Util.get_weekday();
|
1294
1307
|
let year = date.getFullYear();
|
1295
1308
|
let month = date.getMonth() + 1;
|
1296
1309
|
let current_month_format = year + "-" + (month < 10 ? '0' + month : month) + "-01";
|