mm_expand 1.7.4 → 1.7.5
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 +7 -11
- package/package.json +1 -1
- package/test.js +1 -1
package/index.js
CHANGED
|
@@ -1108,23 +1108,19 @@ if (typeof($) === "undefined") {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
};
|
|
1110
1110
|
/**
|
|
1111
|
-
* @description
|
|
1112
|
-
* @return {Date}
|
|
1111
|
+
* @description Convert to time object
|
|
1112
|
+
* @return {Date} time object
|
|
1113
1113
|
*/
|
|
1114
1114
|
String.prototype.toTime = function() {
|
|
1115
1115
|
var str = this;
|
|
1116
1116
|
var time;
|
|
1117
1117
|
if (str.indexOf('T') !== -1) {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
} else {
|
|
1124
|
-
time = new Date(str);
|
|
1125
|
-
}
|
|
1118
|
+
str = str.replace('T', ' ');
|
|
1119
|
+
}
|
|
1120
|
+
if (str.indexOf('Z') !== -1) {
|
|
1121
|
+
str = str.replace('Z', '');
|
|
1122
|
+
time = (new Date(str)).addSeconds(28800);
|
|
1126
1123
|
} else {
|
|
1127
|
-
// str = this.replaceAll('-', '/');
|
|
1128
1124
|
time = new Date(str);
|
|
1129
1125
|
}
|
|
1130
1126
|
return time;
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -8,7 +8,6 @@ require('./index.js');
|
|
|
8
8
|
// console.log(t.toTimestamp());
|
|
9
9
|
// console.log(t.toTimeStr('yyyy-MM-dd hh:mm:ss'));
|
|
10
10
|
// console.log(t.toTimeStr('yyyy-MM-ddThh:mm:ssZ'));
|
|
11
|
-
|
|
12
11
|
// var index = $.eventer.on('update_config', (conf) => {
|
|
13
12
|
// console.log("事件示例", conf);
|
|
14
13
|
// });
|
|
@@ -52,6 +51,7 @@ var time = now.toStr('yyyy-MM-dd hh:mm:ss');
|
|
|
52
51
|
console.log("当前", time);
|
|
53
52
|
console.log("时间", time.toTime().toStr("yyyy-MM-dd hh:mm:ss"));
|
|
54
53
|
console.log("当前", new Date(time).toStr("yyyy-MM-dd hh:mm:ss"));
|
|
54
|
+
console.log(now.toString(), now.toString().toTime().toStr('yyyy-MM-dd hh:mm:ss'));
|
|
55
55
|
|
|
56
56
|
// var time = now.toStr("yyyy-MM-ddThh:mm");
|
|
57
57
|
// console.log("当前", time);
|