mm_expand 1.6.1 → 1.6.3
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/index.js +24 -7
- 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
|
|
1042
|
-
|
|
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 转为时间格式字符串
|
|
@@ -1047,7 +1056,16 @@ if (typeof($) === "undefined") {
|
|
|
1047
1056
|
* @return {String} 时间格式字符串
|
|
1048
1057
|
*/
|
|
1049
1058
|
String.prototype.toTimeFormat = function(format) {
|
|
1050
|
-
var str = this
|
|
1059
|
+
var str = this;
|
|
1060
|
+
return str.toTime().toStr(format);
|
|
1061
|
+
};
|
|
1062
|
+
/**
|
|
1063
|
+
* @description 转为时间格式字符串
|
|
1064
|
+
* @param {String} format 转换的格式
|
|
1065
|
+
* @return {String} 时间格式字符串
|
|
1066
|
+
*/
|
|
1067
|
+
String.prototype.toTimeStr = function(format) {
|
|
1068
|
+
var str = this;
|
|
1051
1069
|
return str.toTime().toStr(format);
|
|
1052
1070
|
};
|
|
1053
1071
|
|
|
@@ -1255,12 +1273,11 @@ if (typeof($) === "undefined") {
|
|
|
1255
1273
|
}
|
|
1256
1274
|
}
|
|
1257
1275
|
if (!file.endsWith(slash)) {
|
|
1258
|
-
if(file.indexOf('.') === -1){
|
|
1276
|
+
if (file.indexOf('.') === -1) {
|
|
1259
1277
|
file += slash;
|
|
1260
|
-
}
|
|
1261
|
-
else {
|
|
1278
|
+
} else {
|
|
1262
1279
|
var arr = file.split(slash);
|
|
1263
|
-
if(arr[arr.length - 1].indexOf('.') === -1){
|
|
1280
|
+
if (arr[arr.length - 1].indexOf('.') === -1) {
|
|
1264
1281
|
file += slash;
|
|
1265
1282
|
}
|
|
1266
1283
|
}
|