@qrvey/utils 1.13.0-0 → 1.13.0-1
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/dist/cjs/dates/adapters/dateToMonthYear.js +3 -1
- package/dist/cjs/dates/constants/INTL_DATE_FORMATS.d.ts +1 -0
- package/dist/cjs/dates/constants/INTL_DATE_FORMATS.js +8 -0
- package/dist/cjs/dates/constants/index.d.ts +1 -0
- package/dist/cjs/dates/constants/index.js +1 -0
- package/dist/dates/adapters/dateToMonthYear.js +3 -1
- package/dist/dates/constants/INTL_DATE_FORMATS.d.ts +1 -0
- package/dist/dates/constants/INTL_DATE_FORMATS.js +5 -0
- package/dist/dates/constants/index.d.ts +1 -0
- package/dist/dates/constants/index.js +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dateToMonthYear = void 0;
|
|
4
4
|
const DATE_YEAR_MONTHS_1 = require("../constants/DATE_YEAR_MONTHS");
|
|
5
|
+
const INTL_DATE_FORMATS_1 = require("../constants/INTL_DATE_FORMATS");
|
|
5
6
|
const getDateByTimezone_1 = require("../helpers/getDateByTimezone");
|
|
6
7
|
const getDefaultDateSettings_1 = require("../helpers/getDefaultDateSettings");
|
|
7
8
|
const isValidDateObject_1 = require("../helpers/isValidDateObject");
|
|
@@ -20,6 +21,7 @@ function dateToMonthYear(date, settings) {
|
|
|
20
21
|
const dt = new Date(timezonedDate.valueOf());
|
|
21
22
|
if (!(0, isValidDateObject_1.isValidDateObject)(dt))
|
|
22
23
|
return date;
|
|
23
|
-
|
|
24
|
+
const year = INTL_DATE_FORMATS_1.INTL_YEAR_FORMAT.format(dt.getFullYear());
|
|
25
|
+
return `${DATE_YEAR_MONTHS_1.DATE_YEAR_MONTHS[dt.getMonth()]} ${year}`;
|
|
24
26
|
}
|
|
25
27
|
exports.dateToMonthYear = dateToMonthYear;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INTL_YEAR_FORMAT: Intl.NumberFormat;
|
|
@@ -58,3 +58,4 @@ __exportStar(require("./ISO_8601_REGEX"), exports);
|
|
|
58
58
|
__exportStar(require("./TIME_GROUPING_PROPERTY_INFO_LIST"), exports);
|
|
59
59
|
__exportStar(require("./TIME_GROUPING_PROPERTY_INFO"), exports);
|
|
60
60
|
__exportStar(require("./TIME_GROUPING_PROPERTY_LABEL"), exports);
|
|
61
|
+
__exportStar(require("./INTL_DATE_FORMATS"), exports);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DATE_YEAR_MONTHS } from "../constants/DATE_YEAR_MONTHS";
|
|
2
|
+
import { INTL_YEAR_FORMAT } from "../constants/INTL_DATE_FORMATS";
|
|
2
3
|
import { getDateByTimezone } from "../helpers/getDateByTimezone";
|
|
3
4
|
import { getDefaultDateSettings } from "../helpers/getDefaultDateSettings";
|
|
4
5
|
import { isValidDateObject } from "../helpers/isValidDateObject";
|
|
@@ -17,5 +18,6 @@ export function dateToMonthYear(date, settings) {
|
|
|
17
18
|
const dt = new Date(timezonedDate.valueOf());
|
|
18
19
|
if (!isValidDateObject(dt))
|
|
19
20
|
return date;
|
|
20
|
-
|
|
21
|
+
const year = INTL_YEAR_FORMAT.format(dt.getFullYear());
|
|
22
|
+
return `${DATE_YEAR_MONTHS[dt.getMonth()]} ${year}`;
|
|
21
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INTL_YEAR_FORMAT: Intl.NumberFormat;
|