mm_expand 1.6.1 → 1.6.2

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/index.js +14 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1038,8 +1038,17 @@ if (typeof($) === "undefined") {
1038
1038
  * @return {Date} 时间对象
1039
1039
  */
1040
1040
  String.prototype.toTime = function() {
1041
- var str = this.replace('T', ' ').replace('Z', '').replaceAll('-', '/');
1042
- return new Date(str);
1041
+ var str = this;
1042
+ var time;
1043
+ if (str.indexOf('T')) {
1044
+ str = this.replace('T', ' ').replace('Z', '').replaceAll('-', '/');
1045
+ time = new Date(str).addSeconds(28800);
1046
+ }
1047
+ else {
1048
+ str = this.replaceAll('-', '/');
1049
+ time = new Date(str);
1050
+ }
1051
+ return time;
1043
1052
  };
1044
1053
  /**
1045
1054
  * @description 转为时间格式字符串
@@ -1255,12 +1264,11 @@ if (typeof($) === "undefined") {
1255
1264
  }
1256
1265
  }
1257
1266
  if (!file.endsWith(slash)) {
1258
- if(file.indexOf('.') === -1){
1267
+ if (file.indexOf('.') === -1) {
1259
1268
  file += slash;
1260
- }
1261
- else {
1269
+ } else {
1262
1270
  var arr = file.split(slash);
1263
- if(arr[arr.length - 1].indexOf('.') === -1){
1271
+ if (arr[arr.length - 1].indexOf('.') === -1) {
1264
1272
  file += slash;
1265
1273
  }
1266
1274
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_expand",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "这是超级美眉原型函数拓展模块,更有利于对string、array、object的操作,避免出错,简化业务逻辑。",
5
5
  "main": "index.js",
6
6
  "scripts": {