sbd-npm 1.2.60 → 1.2.62

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.60",
3
+ "version": "1.2.62",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -1405,6 +1405,7 @@ const Util = {
1405
1405
 
1406
1406
  /**
1407
1407
  * 获取时间戳所在的月份
1408
+ * @param seconds
1408
1409
  * @returns {*|number}
1409
1410
  */
1410
1411
  get_month: function (seconds = 0) {
@@ -1414,6 +1415,7 @@ const Util = {
1414
1415
 
1415
1416
  /**
1416
1417
  * 获取时间戳所在的年份
1418
+ * @param seconds
1417
1419
  * @returns {*|number}
1418
1420
  */
1419
1421
  get_year: function (seconds = 0) {
@@ -1421,6 +1423,16 @@ const Util = {
1421
1423
  return parseInt(Util.seconds_to_format(seconds, "%Y"));
1422
1424
  },
1423
1425
 
1426
+ /**
1427
+ * 获取每年刚开始的时间戳
1428
+ * @param seconds
1429
+ * @returns {*|number}
1430
+ */
1431
+ get_year_second: function(seconds = 0) {
1432
+ let year = Util.get_year(seconds);
1433
+ return Util.format_to_second(year + "-01-01");
1434
+ },
1435
+
1424
1436
  /**
1425
1437
  * 一周的哪一天(1-7,星期一:1,星期二:2,...星期日:7)
1426
1438
  * @returns {*|number}
@@ -2154,7 +2166,7 @@ const Util = {
2154
2166
  if (code_list.length > 0) {
2155
2167
  Util.show_loading();
2156
2168
  let tips_obj = $("#" + element_id + "_tips");
2157
- if (tips_obj.length && tips_obj.html().length === 0) {
2169
+ if (tips_obj.length) {
2158
2170
  tips_obj.html('共 <span class="label label-info">' + code_list.length + '</span> 家');
2159
2171
  }
2160
2172
  //获取股票详情数据