@react-pakistan/util-functions 1.23.65 → 1.23.66

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,6 +1,8 @@
1
1
  export declare enum DATE_FORMATS {
2
2
  LOCALE_DATE = "LOCALE_DATE",
3
3
  DD_MM = "DD_MM",
4
- YYYY_MM_DD = "YYYY_MM_DD"
4
+ YYYY_MM_DD = "YYYY_MM_DD",
5
+ DAY_DD_YYYY = "DAY_DD_YYYY",
6
+ DAY_DD_YY_COMPACT = "DAY_DD_YY_COMPACT"
5
7
  }
6
8
  export declare const formatDate: (str: string, format: DATE_FORMATS) => string;
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/indent */
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.formatDate = exports.DATE_FORMATS = void 0;
5
+ var get_day_name_1 = require("./get-day-name");
4
6
  var get_month_name_1 = require("./get-month-name");
5
7
  var DATE_FORMATS;
6
8
  (function (DATE_FORMATS) {
7
9
  DATE_FORMATS["LOCALE_DATE"] = "LOCALE_DATE";
8
10
  DATE_FORMATS["DD_MM"] = "DD_MM";
9
11
  DATE_FORMATS["YYYY_MM_DD"] = "YYYY_MM_DD";
12
+ DATE_FORMATS["DAY_DD_YYYY"] = "DAY_DD_YYYY";
13
+ DATE_FORMATS["DAY_DD_YY_COMPACT"] = "DAY_DD_YY_COMPACT";
10
14
  })(DATE_FORMATS || (exports.DATE_FORMATS = DATE_FORMATS = {}));
11
15
  var formatDate = function (str, format) {
12
16
  var _a;
@@ -19,6 +23,12 @@ var formatDate = function (str, format) {
19
23
  _a[DATE_FORMATS.LOCALE_DATE] = dateObj.toLocaleDateString(),
20
24
  _a[DATE_FORMATS.DD_MM] = "".concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth())),
21
25
  _a[DATE_FORMATS.YYYY_MM_DD] = "".concat(dateObj.getFullYear(), "-").concat(monthNumberInTwoDigits, "-").concat(dateNumberInTowDigits),
26
+ _a[DATE_FORMATS.DAY_DD_YYYY] = "".concat((0, get_day_name_1.getDayName)(dateObj
27
+ .getDay()), ", ").concat(dateObj
28
+ .getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth()), " ").concat(dateObj.getFullYear()),
29
+ _a[DATE_FORMATS.DAY_DD_YY_COMPACT] = "".concat((0, get_day_name_1.getDayName)(dateObj.getDay())
30
+ .slice(3), ", ").concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj
31
+ .getMonth()), " ").concat(String(dateObj.getFullYear()).slice(2, 5)),
22
32
  _a);
23
33
  return dateMap[format];
24
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.23.65",
3
+ "version": "1.23.66",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {