zet-lib 1.0.30 → 1.0.31

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/lib/Util.js +3 -3
  2. package/package.json +2 -1
package/lib/Util.js CHANGED
@@ -1,4 +1,4 @@
1
- const moment = require('moment');
1
+ const moment = require('moment-timezone');
2
2
  const path = require('path');
3
3
  const randomstring = require("randomstring");
4
4
  const fs = require('fs-extra');
@@ -78,10 +78,10 @@ Util.dateSql = function (date, format) {
78
78
  return '';
79
79
  };
80
80
 
81
- Util.dateFormat = function (date, format) {
81
+ Util.dateFormat = function (date, format, tz='Asia/Jakarta') {
82
82
  format = format || "YYYY-MM-DD";
83
83
  if (date && date != "0000-00-00")
84
- return moment(date).format(format);
84
+ return moment(date).tz(tz).format(format);
85
85
  else
86
86
  return '';
87
87
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -37,6 +37,7 @@
37
37
  "html-minifier-terser": "^7.2.0",
38
38
  "js-sha256": "^0.9.0",
39
39
  "moment": "^2.29.4",
40
+ "moment-timezone": "^0.5.43",
40
41
  "node-cache": "^5.1.2",
41
42
  "nodemailer": "^6.9.4",
42
43
  "pg": "^8.11.2",