utiller 1.0.232 → 1.0.233
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/lib/utiller/index.js +18 -0
- package/package.json +1 -1
- package/template/sample.package.json +1 -1
package/lib/utiller/index.js
CHANGED
|
@@ -164,6 +164,18 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
164
164
|
array.length = 0;
|
|
165
165
|
array.push.apply(array, (0, _toConsumableArray2["default"])(combine));
|
|
166
166
|
});
|
|
167
|
+
/** 西元年 轉成 民國年
|
|
168
|
+
* full = 是否打印出全名 民國 XX 年
|
|
169
|
+
* */
|
|
170
|
+
(0, _defineProperty2["default"])(this, "getStringOfYearADConvertToMinguoYear", function (gregorianYear) {
|
|
171
|
+
var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
172
|
+
var minguoYear = gregorianYear - 1911;
|
|
173
|
+
if (minguoYear > 0) {
|
|
174
|
+
return "".concat(full ? "民國" : "").concat(minguoYear).concat(full ? "年" : "");
|
|
175
|
+
} else {
|
|
176
|
+
return "".concat(full ? "民國" : "", "\u524D").concat(Math.abs(minguoYear)).concat(full ? "年" : "");
|
|
177
|
+
}
|
|
178
|
+
});
|
|
167
179
|
this.init();
|
|
168
180
|
this.env = "dev";
|
|
169
181
|
}
|
|
@@ -1393,6 +1405,12 @@ var Utiller = /*#__PURE__*/function () {
|
|
|
1393
1405
|
value: function getTodayTimeFormat(ts) {
|
|
1394
1406
|
return (0, _moment["default"])(ts ? ts : this.getCurrentTimeStamp()).format("YYYY-MM-DD");
|
|
1395
1407
|
}
|
|
1408
|
+
}, {
|
|
1409
|
+
key: "getCustomFormat",
|
|
1410
|
+
value: function getCustomFormat(ts) {
|
|
1411
|
+
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "YY/MM";
|
|
1412
|
+
return (0, _moment["default"])(ts ? ts : this.getCurrentTimeStamp()).format(format);
|
|
1413
|
+
}
|
|
1396
1414
|
}, {
|
|
1397
1415
|
key: "getSimpleDateYYMMDDFormat",
|
|
1398
1416
|
value: function getSimpleDateYYMMDDFormat(ts) {
|
package/package.json
CHANGED