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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utiller",
3
- "version": "1.0.232",
3
+ "version": "1.0.233",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
13
  "configerer": "^1.0.11",
14
- "utiller": "^1.0.231",
14
+ "utiller": "^1.0.232",
15
15
  "linepayer": "^1.0.4",
16
16
  "databazer": "^1.0.12",
17
17
  "lodash": "^4.17.20",