@react-pakistan/util-functions 1.24.38 → 1.24.39
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/general/format-date.js +3 -3
- package/package.json +1 -1
package/general/format-date.js
CHANGED
|
@@ -14,6 +14,7 @@ var DATE_FORMATS;
|
|
|
14
14
|
})(DATE_FORMATS || (exports.DATE_FORMATS = DATE_FORMATS = {}));
|
|
15
15
|
var formatDate = function (str, format) {
|
|
16
16
|
var _a;
|
|
17
|
+
var _b, _c;
|
|
17
18
|
var dateObj = new Date(str);
|
|
18
19
|
var cleanMonthNumber = dateObj.getMonth() + 1;
|
|
19
20
|
var monthNumberInTwoDigits = String(cleanMonthNumber).length < 2 ? "0".concat(cleanMonthNumber) : cleanMonthNumber;
|
|
@@ -26,9 +27,8 @@ var formatDate = function (str, format) {
|
|
|
26
27
|
_a[DATE_FORMATS.DAY_DD_MM_YYYY] = "".concat((0, get_day_name_1.getDayName)(dateObj
|
|
27
28
|
.getDay()), ", ").concat(dateObj
|
|
28
29
|
.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj.getMonth()), " ").concat(dateObj.getFullYear()),
|
|
29
|
-
_a[DATE_FORMATS.DAY_DD_MM_YY_COMPACT] = "".concat((0, get_day_name_1.getDayName)(dateObj.getDay())
|
|
30
|
-
.
|
|
31
|
-
.getMonth()), " ").concat(String(dateObj.getFullYear()).slice(2, 5)),
|
|
30
|
+
_a[DATE_FORMATS.DAY_DD_MM_YY_COMPACT] = "".concat((_b = (0, get_day_name_1.getDayName)(dateObj.getDay())) === null || _b === void 0 ? void 0 : _b.slice(0, 3), ", ").concat(dateObj.getDate(), " ").concat((0, get_month_name_1.getMonthName)(dateObj
|
|
31
|
+
.getMonth()), " ").concat((_c = String(dateObj.getFullYear())) === null || _c === void 0 ? void 0 : _c.slice(2, 5)),
|
|
32
32
|
_a);
|
|
33
33
|
return dateMap[format];
|
|
34
34
|
};
|