qmwts 1.2.8 → 1.2.9

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.
@@ -1,4 +1,5 @@
1
1
  import { DateTime } from 'luxon';
2
2
  export declare const formatDateDiff: (date1: any, date2?: any) => string;
3
3
  export declare const formatDateTime: (date: any) => string;
4
+ export declare const formatDate: (date: any) => string;
4
5
  export declare const parseDate: (date: any) => DateTime | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseDate = exports.formatDateTime = exports.formatDateDiff = void 0;
3
+ exports.parseDate = exports.formatDate = exports.formatDateTime = exports.formatDateDiff = void 0;
4
4
  const luxon_1 = require("luxon");
5
5
  const prototype_utils2_1 = require("./prototype-utils2");
6
6
  const formatDateDiff = (date1, date2) => {
@@ -29,6 +29,11 @@ const formatDateTime = (date) => {
29
29
  return date ? date.toFormat('yyyy-MM-dd HH:mm') : '';
30
30
  };
31
31
  exports.formatDateTime = formatDateTime;
32
+ const formatDate = (date) => {
33
+ date = (0, exports.parseDate)(date);
34
+ return date ? date.toFormat('yyyy-MM-dd') : '';
35
+ };
36
+ exports.formatDate = formatDate;
32
37
  const parseDate = (date) => {
33
38
  let luxonDate = void 0;
34
39
  if (date instanceof luxon_1.DateTime)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qmwts",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",