sbd-npm 1.2.60 → 1.2.61
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/package.json +1 -1
- package/util.js +12 -0
package/package.json
CHANGED
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}
|