@qrvey/utils 1.10.1 → 1.11.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/ISOToNumericOffset.d.ts +1 -1
- package/dist/cjs/dates/adapters/ISOToNumericOffset.js +1 -1
- package/dist/cjs/dates/adapters/dateToHms.d.ts +5 -4
- package/dist/cjs/dates/adapters/dateToHms.js +14 -14
- package/dist/cjs/dates/adapters/dateToMdyDate.d.ts +5 -3
- package/dist/cjs/dates/adapters/dateToMdyDate.js +3 -2
- package/dist/cjs/dates/adapters/dateToMonthYear.d.ts +5 -3
- package/dist/cjs/dates/adapters/dateToMonthYear.js +3 -2
- package/dist/cjs/dates/adapters/dateToQuarterYear.d.ts +5 -3
- package/dist/cjs/dates/adapters/dateToQuarterYear.js +3 -2
- package/dist/cjs/dates/adapters/dateToWeekYear.d.ts +5 -3
- package/dist/cjs/dates/adapters/dateToWeekYear.js +3 -2
- package/dist/cjs/dates/adapters/dateToYear.d.ts +5 -3
- package/dist/cjs/dates/adapters/dateToYear.js +3 -2
- package/dist/cjs/dates/adapters/hmsToDate.d.ts +5 -4
- package/dist/cjs/dates/adapters/hmsToDate.js +3 -3
- package/dist/cjs/dates/adapters/mdyDateToDate.d.ts +5 -4
- package/dist/cjs/dates/adapters/mdyDateToDate.js +3 -3
- package/dist/cjs/dates/adapters/monthYearToDate.d.ts +5 -4
- package/dist/cjs/dates/adapters/monthYearToDate.js +3 -3
- package/dist/cjs/dates/adapters/numericOffsetToISO.d.ts +1 -1
- package/dist/cjs/dates/adapters/numericOffsetToISO.js +1 -3
- package/dist/cjs/dates/adapters/quarterYearToDate.d.ts +5 -4
- package/dist/cjs/dates/adapters/quarterYearToDate.js +3 -3
- package/dist/cjs/dates/adapters/weekYearToDate.d.ts +5 -4
- package/dist/cjs/dates/adapters/weekYearToDate.js +3 -3
- package/dist/cjs/dates/adapters/yearToDate.d.ts +5 -4
- package/dist/cjs/dates/adapters/yearToDate.js +3 -3
- package/dist/cjs/dates/constants/ISO_8601_REGEX.d.ts +11 -0
- package/dist/cjs/dates/constants/ISO_8601_REGEX.js +12 -1
- package/dist/cjs/dates/helpers/areIncludedDateTokens.d.ts +3 -3
- package/dist/cjs/dates/helpers/areIncludedDateTokens.js +3 -3
- package/dist/cjs/dates/helpers/getDateByDateFormat.d.ts +6 -5
- package/dist/cjs/dates/helpers/getDateByDateFormat.js +4 -4
- package/dist/cjs/dates/helpers/getDateByTimezone.d.ts +4 -3
- package/dist/cjs/dates/helpers/getDateByTimezone.js +2 -2
- package/dist/cjs/dates/helpers/getDateByTimezoneOffset.d.ts +6 -3
- package/dist/cjs/dates/helpers/getDateByTimezoneOffset.js +3 -2
- package/dist/cjs/dates/helpers/getDateFormatByProperty.d.ts +2 -2
- package/dist/cjs/dates/helpers/getDateFormatByProperty.js +2 -2
- package/dist/cjs/dates/helpers/getDateFormatRegularExpressionInArray.d.ts +1 -1
- package/dist/cjs/dates/helpers/getDateFormatRegularExpressionInArray.js +1 -1
- package/dist/cjs/dates/helpers/getDefaultDateSettings.d.ts +2 -2
- package/dist/cjs/dates/helpers/getDefaultDateSettings.js +2 -2
- package/dist/cjs/dates/helpers/getFormattedDateByFormat.d.ts +6 -4
- package/dist/cjs/dates/helpers/getFormattedDateByFormat.js +4 -3
- package/dist/cjs/dates/helpers/getSeparatorByDateFormat.d.ts +1 -1
- package/dist/cjs/dates/helpers/getSeparatorByDateFormat.js +1 -1
- package/dist/cjs/dates/helpers/getTimezoneObject.d.ts +1 -1
- package/dist/cjs/dates/helpers/getTimezoneObject.js +8 -5
- package/dist/cjs/dates/helpers/getTimezoneOffsetByType.js +1 -1
- package/dist/cjs/dates/helpers/getUTCFormatByOffset.d.ts +1 -0
- package/dist/cjs/dates/helpers/getUTCFormatByOffset.js +1 -0
- package/dist/cjs/dates/helpers/getWeek.d.ts +1 -1
- package/dist/cjs/dates/helpers/getWeek.js +1 -1
- package/dist/cjs/dates/helpers/index.d.ts +2 -0
- package/dist/cjs/dates/helpers/index.js +2 -0
- package/dist/cjs/dates/helpers/isValidDateObject.d.ts +1 -1
- package/dist/cjs/dates/helpers/isValidDateObject.js +1 -1
- package/dist/cjs/dates/helpers/isValidISOOffset.d.ts +3 -2
- package/dist/cjs/dates/helpers/isValidISOOffset.js +3 -2
- package/dist/cjs/dates/helpers/isValidPotentialDate.d.ts +3 -2
- package/dist/cjs/dates/helpers/isValidPotentialDate.js +16 -1
- package/dist/cjs/dates/helpers/isValidTimezoneOffset.d.ts +7 -0
- package/dist/cjs/dates/helpers/isValidTimezoneOffset.js +31 -0
- package/dist/cjs/dates/helpers/validateDate.d.ts +3 -3
- package/dist/cjs/dates/helpers/validateDate.js +3 -3
- package/dist/cjs/dates/interfaces/IDate.d.ts +1 -0
- package/dist/cjs/dates/interfaces/IDate.js +2 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterDatasets.d.ts +9 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterDatasets.js +94 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterFilters.d.ts +9 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterFilters.js +97 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterScopes.d.ts +9 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterScopes.js +100 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterValues.d.ts +9 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilterValues.js +100 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilters.d.ts +10 -0
- package/dist/cjs/filters/helpers/common/getVerboseFilters.js +91 -0
- package/dist/cjs/filters/helpers/common/index.d.ts +5 -0
- package/dist/cjs/filters/helpers/common/index.js +5 -0
- package/dist/cjs/filters/helpers/settings/getFilterSettings.js +1 -6
- package/dist/cjs/filters/helpers/ui/getUIValues.js +3 -1
- package/dist/cjs/filters/interfaces/functions/IFFGetVerboseFilters.d.ts +34 -0
- package/dist/cjs/filters/interfaces/functions/IFFGetVerboseFilters.js +2 -0
- package/dist/cjs/globalization/labels/bucket_builder/I18N_BUCKET_BUILDER.js +1 -1
- package/dist/cjs/globalization/labels/index.d.ts +0 -1
- package/dist/cjs/globalization/labels/index.js +0 -1
- package/dist/dates/adapters/ISOToNumericOffset.d.ts +1 -1
- package/dist/dates/adapters/ISOToNumericOffset.js +1 -1
- package/dist/dates/adapters/dateToHms.d.ts +5 -4
- package/dist/dates/adapters/dateToHms.js +14 -14
- package/dist/dates/adapters/dateToMdyDate.d.ts +5 -3
- package/dist/dates/adapters/dateToMdyDate.js +3 -2
- package/dist/dates/adapters/dateToMonthYear.d.ts +5 -3
- package/dist/dates/adapters/dateToMonthYear.js +3 -2
- package/dist/dates/adapters/dateToQuarterYear.d.ts +5 -3
- package/dist/dates/adapters/dateToQuarterYear.js +3 -2
- package/dist/dates/adapters/dateToWeekYear.d.ts +5 -3
- package/dist/dates/adapters/dateToWeekYear.js +3 -2
- package/dist/dates/adapters/dateToYear.d.ts +5 -3
- package/dist/dates/adapters/dateToYear.js +3 -2
- package/dist/dates/adapters/hmsToDate.d.ts +5 -4
- package/dist/dates/adapters/hmsToDate.js +3 -3
- package/dist/dates/adapters/mdyDateToDate.d.ts +5 -4
- package/dist/dates/adapters/mdyDateToDate.js +3 -3
- package/dist/dates/adapters/monthYearToDate.d.ts +5 -4
- package/dist/dates/adapters/monthYearToDate.js +3 -3
- package/dist/dates/adapters/numericOffsetToISO.d.ts +1 -1
- package/dist/dates/adapters/numericOffsetToISO.js +1 -3
- package/dist/dates/adapters/quarterYearToDate.d.ts +5 -4
- package/dist/dates/adapters/quarterYearToDate.js +3 -3
- package/dist/dates/adapters/weekYearToDate.d.ts +5 -4
- package/dist/dates/adapters/weekYearToDate.js +3 -3
- package/dist/dates/adapters/yearToDate.d.ts +5 -4
- package/dist/dates/adapters/yearToDate.js +3 -3
- package/dist/dates/constants/ISO_8601_REGEX.d.ts +11 -0
- package/dist/dates/constants/ISO_8601_REGEX.js +12 -1
- package/dist/dates/helpers/areIncludedDateTokens.d.ts +3 -3
- package/dist/dates/helpers/areIncludedDateTokens.js +3 -3
- package/dist/dates/helpers/getDateByDateFormat.d.ts +6 -5
- package/dist/dates/helpers/getDateByDateFormat.js +4 -4
- package/dist/dates/helpers/getDateByTimezone.d.ts +4 -3
- package/dist/dates/helpers/getDateByTimezone.js +2 -2
- package/dist/dates/helpers/getDateByTimezoneOffset.d.ts +6 -3
- package/dist/dates/helpers/getDateByTimezoneOffset.js +3 -2
- package/dist/dates/helpers/getDateFormatByProperty.d.ts +2 -2
- package/dist/dates/helpers/getDateFormatByProperty.js +2 -2
- package/dist/dates/helpers/getDateFormatRegularExpressionInArray.d.ts +1 -1
- package/dist/dates/helpers/getDateFormatRegularExpressionInArray.js +1 -1
- package/dist/dates/helpers/getDefaultDateSettings.d.ts +2 -2
- package/dist/dates/helpers/getDefaultDateSettings.js +2 -2
- package/dist/dates/helpers/getFormattedDateByFormat.d.ts +6 -4
- package/dist/dates/helpers/getFormattedDateByFormat.js +4 -3
- package/dist/dates/helpers/getSeparatorByDateFormat.d.ts +1 -1
- package/dist/dates/helpers/getSeparatorByDateFormat.js +1 -1
- package/dist/dates/helpers/getTimezoneObject.d.ts +1 -1
- package/dist/dates/helpers/getTimezoneObject.js +8 -5
- package/dist/dates/helpers/getTimezoneOffsetByType.js +1 -1
- package/dist/dates/helpers/getUTCFormatByOffset.d.ts +1 -0
- package/dist/dates/helpers/getUTCFormatByOffset.js +1 -0
- package/dist/dates/helpers/getWeek.d.ts +1 -1
- package/dist/dates/helpers/getWeek.js +1 -1
- package/dist/dates/helpers/index.d.ts +2 -0
- package/dist/dates/helpers/index.js +2 -0
- package/dist/dates/helpers/isValidDateObject.d.ts +1 -1
- package/dist/dates/helpers/isValidDateObject.js +1 -1
- package/dist/dates/helpers/isValidISOOffset.d.ts +3 -2
- package/dist/dates/helpers/isValidISOOffset.js +3 -2
- package/dist/dates/helpers/isValidPotentialDate.d.ts +3 -2
- package/dist/dates/helpers/isValidPotentialDate.js +16 -1
- package/dist/dates/helpers/isValidTimezoneOffset.d.ts +7 -0
- package/dist/dates/helpers/isValidTimezoneOffset.js +27 -0
- package/dist/dates/helpers/validateDate.d.ts +3 -3
- package/dist/dates/helpers/validateDate.js +3 -3
- package/dist/dates/interfaces/IDate.d.ts +1 -0
- package/dist/dates/interfaces/IDate.js +1 -0
- package/dist/filters/helpers/common/getVerboseFilterDatasets.d.ts +9 -0
- package/dist/filters/helpers/common/getVerboseFilterDatasets.js +90 -0
- package/dist/filters/helpers/common/getVerboseFilterFilters.d.ts +9 -0
- package/dist/filters/helpers/common/getVerboseFilterFilters.js +93 -0
- package/dist/filters/helpers/common/getVerboseFilterScopes.d.ts +9 -0
- package/dist/filters/helpers/common/getVerboseFilterScopes.js +96 -0
- package/dist/filters/helpers/common/getVerboseFilterValues.d.ts +9 -0
- package/dist/filters/helpers/common/getVerboseFilterValues.js +96 -0
- package/dist/filters/helpers/common/getVerboseFilters.d.ts +10 -0
- package/dist/filters/helpers/common/getVerboseFilters.js +86 -0
- package/dist/filters/helpers/common/index.d.ts +5 -0
- package/dist/filters/helpers/common/index.js +5 -0
- package/dist/filters/helpers/settings/getFilterSettings.js +1 -6
- package/dist/filters/helpers/ui/getUIValues.js +3 -1
- package/dist/filters/interfaces/functions/IFFGetVerboseFilters.d.ts +34 -0
- package/dist/filters/interfaces/functions/IFFGetVerboseFilters.js +1 -0
- package/dist/globalization/labels/bucket_builder/I18N_BUCKET_BUILDER.js +1 -1
- package/dist/globalization/labels/index.d.ts +0 -1
- package/dist/globalization/labels/index.js +0 -1
- package/package.json +1 -1
- package/dist/cjs/globalization/labels/columns/I18N_COLUMN.d.ts +0 -2
- package/dist/cjs/globalization/labels/columns/I18N_COLUMN.js +0 -8
- package/dist/cjs/globalization/labels/columns/index.d.ts +0 -1
- package/dist/cjs/globalization/labels/columns/index.js +0 -17
- package/dist/globalization/labels/columns/I18N_COLUMN.d.ts +0 -2
- package/dist/globalization/labels/columns/I18N_COLUMN.js +0 -5
- package/dist/globalization/labels/columns/index.d.ts +0 -1
- package/dist/globalization/labels/columns/index.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Gets the numeric offset (minutes) from the ISO offset (string)
|
|
3
|
-
* @param {string} offset the timezone offset
|
|
3
|
+
* @param {number | string} offset the timezone offset
|
|
4
4
|
* @returns {number} the offset in minutes
|
|
5
5
|
*/
|
|
6
6
|
export declare function ISOToNumericOffset(offset: number | string): number;
|
|
@@ -6,7 +6,7 @@ const getSign_1 = require("../../general/numeric/getSign");
|
|
|
6
6
|
const isValidISOOffset_1 = require("../helpers/isValidISOOffset");
|
|
7
7
|
/**
|
|
8
8
|
* Gets the numeric offset (minutes) from the ISO offset (string)
|
|
9
|
-
* @param {string} offset the timezone offset
|
|
9
|
+
* @param {number | string} offset the timezone offset
|
|
10
10
|
* @returns {number} the offset in minutes
|
|
11
11
|
*/
|
|
12
12
|
function ISOToNumericOffset(offset) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IDFDateToHmsSettings } from "../interfaces/IDFDateToHmsSettings";
|
|
2
|
+
import { IDate } from "../interfaces/IDate";
|
|
2
3
|
/**
|
|
3
4
|
* * Transform a Date to [HH:mm:ss] date format.
|
|
4
|
-
* @param date String, object or millisencond number of the date
|
|
5
|
-
* @param settings the settings of the dateToHms function
|
|
6
|
-
* @returns string of [HH:mm:ss] date format
|
|
5
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
6
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
7
|
+
* @returns {string} string of [HH:mm:ss] date format
|
|
7
8
|
*/
|
|
8
|
-
export declare function dateToHms(date:
|
|
9
|
+
export declare function dateToHms(date: IDate, settings?: IDFDateToHmsSettings): string;
|
|
@@ -7,9 +7,9 @@ const isValidDateObject_1 = require("../helpers/isValidDateObject");
|
|
|
7
7
|
const isValidPotentialDate_1 = require("../helpers/isValidPotentialDate");
|
|
8
8
|
/**
|
|
9
9
|
* * Transform a Date to [HH:mm:ss] date format.
|
|
10
|
-
* @param date String, object or millisencond number of the date
|
|
11
|
-
* @param settings the settings of the dateToHms function
|
|
12
|
-
* @returns string of [HH:mm:ss] date format
|
|
10
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
11
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
12
|
+
* @returns {string} string of [HH:mm:ss] date format
|
|
13
13
|
*/
|
|
14
14
|
function dateToHms(date, settings) {
|
|
15
15
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date))
|
|
@@ -27,8 +27,8 @@ function dateToHms(date, settings) {
|
|
|
27
27
|
exports.dateToHms = dateToHms;
|
|
28
28
|
/**
|
|
29
29
|
* Gets the settings for this function.
|
|
30
|
-
* @param settings the settings of the dateToHms function
|
|
31
|
-
* @returns a new object for the settings
|
|
30
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
31
|
+
* @returns {IDFDateToHmsSettings} a new object for the settings
|
|
32
32
|
*/
|
|
33
33
|
function getDefaultSettings(settings) {
|
|
34
34
|
var _a, _b, _c;
|
|
@@ -36,27 +36,27 @@ function getDefaultSettings(settings) {
|
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Gets the Hours
|
|
39
|
-
* @param date the date object
|
|
40
|
-
* @param settings the settings of the dateToHms function
|
|
41
|
-
* @returns the hour string
|
|
39
|
+
* @param {Date} date the date object
|
|
40
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
41
|
+
* @returns {string} the hour string
|
|
42
42
|
*/
|
|
43
43
|
function getHours(date, settings) {
|
|
44
44
|
return (0, padLeadingZeros_1.padLeadingZeros)(settings.omitHour ? "0" : date.getHours(), 2).slice(-2);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Gets the Minutes
|
|
48
|
-
* @param date the date object
|
|
49
|
-
* @param settings the settings of the dateToHms function
|
|
50
|
-
* @returns the minute string
|
|
48
|
+
* @param {Date} date the date object
|
|
49
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
50
|
+
* @returns {string} the minute string
|
|
51
51
|
*/
|
|
52
52
|
function getMinutes(date, settings) {
|
|
53
53
|
return (0, padLeadingZeros_1.padLeadingZeros)(settings.omitMinute ? "0" : date.getMinutes(), 2).slice(-2);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Gets the Seconds
|
|
57
|
-
* @param date the date object
|
|
58
|
-
* @param settings the settings of the dateToHms function
|
|
59
|
-
* @returns the seconds string
|
|
57
|
+
* @param {Date} date the date object
|
|
58
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
59
|
+
* @returns {string} the seconds string
|
|
60
60
|
*/
|
|
61
61
|
function getSeconds(date, settings) {
|
|
62
62
|
return (0, padLeadingZeros_1.padLeadingZeros)(settings.omitSecond ? "0" : date.getSeconds(), 2).slice(-2);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transform a Date to [mm/dd/yyyy] date format.
|
|
4
|
-
* @param date String, object or millisencond number of the date
|
|
5
|
-
* @
|
|
5
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {string} string of [mm/dd/yyyy] date format
|
|
6
8
|
*/
|
|
7
|
-
export declare function dateToMdyDate(date:
|
|
9
|
+
export declare function dateToMdyDate(date: IDate, settings?: IDateSettings): string;
|
|
@@ -9,8 +9,9 @@ const isValidPotentialDate_1 = require("../helpers/isValidPotentialDate");
|
|
|
9
9
|
const dateToHms_1 = require("./dateToHms");
|
|
10
10
|
/**
|
|
11
11
|
* Transform a Date to [mm/dd/yyyy] date format.
|
|
12
|
-
* @param date String, object or millisencond number of the date
|
|
13
|
-
* @
|
|
12
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
13
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
14
|
+
* @returns {string} string of [mm/dd/yyyy] date format
|
|
14
15
|
*/
|
|
15
16
|
function dateToMdyDate(date, settings) {
|
|
16
17
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date))
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transform a Date to [Month Year] date format.
|
|
4
|
-
* @param date String, object or millisencond number of the date
|
|
5
|
-
* @
|
|
5
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {string} string of [Month Year] date format
|
|
6
8
|
*/
|
|
7
|
-
export declare function dateToMonthYear(date:
|
|
9
|
+
export declare function dateToMonthYear(date: IDate, settings?: IDateSettings): string;
|
|
@@ -8,8 +8,9 @@ const isValidDateObject_1 = require("../helpers/isValidDateObject");
|
|
|
8
8
|
const isValidPotentialDate_1 = require("../helpers/isValidPotentialDate");
|
|
9
9
|
/**
|
|
10
10
|
* Transform a Date to [Month Year] date format.
|
|
11
|
-
* @param date String, object or millisencond number of the date
|
|
12
|
-
* @
|
|
11
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
12
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
13
|
+
* @returns {string} string of [Month Year] date format
|
|
13
14
|
*/
|
|
14
15
|
function dateToMonthYear(date, settings) {
|
|
15
16
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date))
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transform a valid Date to [Quarter Year] date format.
|
|
4
|
-
* @param date String of a valid date, date object or millisencond number of the date
|
|
5
|
-
* @
|
|
5
|
+
* @param {IDate} date String of a valid date, date object or millisencond number of the date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {string} string of [Quarter Year] date format
|
|
6
8
|
*/
|
|
7
|
-
export declare function dateToQuarterYear(date:
|
|
9
|
+
export declare function dateToQuarterYear(date: IDate, settings?: IDateSettings): string;
|
|
@@ -8,8 +8,9 @@ const isValidDateObject_1 = require("../helpers/isValidDateObject");
|
|
|
8
8
|
const isValidPotentialDate_1 = require("../helpers/isValidPotentialDate");
|
|
9
9
|
/**
|
|
10
10
|
* Transform a valid Date to [Quarter Year] date format.
|
|
11
|
-
* @param date String of a valid date, date object or millisencond number of the date
|
|
12
|
-
* @
|
|
11
|
+
* @param {IDate} date String of a valid date, date object or millisencond number of the date
|
|
12
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
13
|
+
* @returns {string} string of [Quarter Year] date format
|
|
13
14
|
*/
|
|
14
15
|
function dateToQuarterYear(date, settings) {
|
|
15
16
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date))
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transform a Date to [W# Year] date format.
|
|
4
|
-
* @param date String, object or millisencond number of the date
|
|
5
|
-
* @
|
|
5
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {string} string of [W# Year] date format
|
|
6
8
|
*/
|
|
7
|
-
export declare function dateToWeekYear(date:
|
|
9
|
+
export declare function dateToWeekYear(date: IDate, settings?: IDateSettings): string;
|
|
@@ -8,8 +8,9 @@ const isValidDateObject_1 = require("../helpers/isValidDateObject");
|
|
|
8
8
|
const isValidPotentialDate_1 = require("../helpers/isValidPotentialDate");
|
|
9
9
|
/**
|
|
10
10
|
* Transform a Date to [W# Year] date format.
|
|
11
|
-
* @param date String, object or millisencond number of the date
|
|
12
|
-
* @
|
|
11
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
12
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
13
|
+
* @returns {string} string of [W# Year] date format
|
|
13
14
|
*/
|
|
14
15
|
function dateToWeekYear(date, settings) {
|
|
15
16
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date))
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transform a Date to [Year] date format.
|
|
4
|
-
* @param {
|
|
5
|
-
* @
|
|
5
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {string} string of [Year] date format
|
|
6
8
|
*/
|
|
7
|
-
export declare function dateToYear(date:
|
|
9
|
+
export declare function dateToYear(date: IDate, settings?: IDateSettings): string;
|
|
@@ -7,8 +7,9 @@ const isValidDateObject_1 = require("../helpers/isValidDateObject");
|
|
|
7
7
|
const isValidPotentialDate_1 = require("../helpers/isValidPotentialDate");
|
|
8
8
|
/**
|
|
9
9
|
* Transform a Date to [Year] date format.
|
|
10
|
-
* @param {
|
|
11
|
-
* @
|
|
10
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
11
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
12
|
+
* @returns {string} string of [Year] date format
|
|
12
13
|
*/
|
|
13
14
|
function dateToYear(date, settings) {
|
|
14
15
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transforms String time from a [H:m:s] format to Date object.
|
|
4
|
-
* @param monthYearDate String of [H:m:s] time
|
|
5
|
-
* @param
|
|
6
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected time, the function will return the same value
|
|
5
|
+
* @param {string} monthYearDate String of [H:m:s] time
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected time, the function will return the same value
|
|
7
8
|
*/
|
|
8
|
-
export declare function hmsToDate(hmsDate: string, settings?: IDateSettings):
|
|
9
|
+
export declare function hmsToDate(hmsDate: string, settings?: IDateSettings): IDate;
|
|
@@ -9,9 +9,9 @@ const getDefaultDateSettings_1 = require("../helpers/getDefaultDateSettings");
|
|
|
9
9
|
const validateDate_1 = require("../helpers/validateDate");
|
|
10
10
|
/**
|
|
11
11
|
* Transforms String time from a [H:m:s] format to Date object.
|
|
12
|
-
* @param monthYearDate String of [H:m:s] time
|
|
13
|
-
* @param
|
|
14
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected time, the function will return the same value
|
|
12
|
+
* @param {string} monthYearDate String of [H:m:s] time
|
|
13
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
14
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected time, the function will return the same value
|
|
15
15
|
*/
|
|
16
16
|
function hmsToDate(hmsDate, settings) {
|
|
17
17
|
if ((0, isEmpty_1.isEmpty)(hmsDate) ||
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transforms String Date from a [mm/dd/yyyy] format to Date object.
|
|
4
|
-
* @param monthYearDate String of [mm/dd/yyyy] date
|
|
5
|
-
* @param
|
|
6
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
5
|
+
* @param {string}monthYearDate String of [mm/dd/yyyy] date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
7
8
|
*/
|
|
8
|
-
export declare function mdyDateToDate(date: string, settings?: IDateSettings):
|
|
9
|
+
export declare function mdyDateToDate(date: string, settings?: IDateSettings): IDate;
|
|
@@ -9,9 +9,9 @@ const getDefaultDateSettings_1 = require("../helpers/getDefaultDateSettings");
|
|
|
9
9
|
const validateDate_1 = require("../helpers/validateDate");
|
|
10
10
|
/**
|
|
11
11
|
* Transforms String Date from a [mm/dd/yyyy] format to Date object.
|
|
12
|
-
* @param monthYearDate String of [mm/dd/yyyy] date
|
|
13
|
-
* @param
|
|
14
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
12
|
+
* @param {string}monthYearDate String of [mm/dd/yyyy] date
|
|
13
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
14
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
15
15
|
*/
|
|
16
16
|
function mdyDateToDate(date, settings) {
|
|
17
17
|
if ((0, isEmpty_1.isEmpty)(date) ||
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transforms String Date from a [Month Year] format to Date object.
|
|
4
|
-
* @param monthYearDate String of [Month Year] date
|
|
5
|
-
* @param
|
|
6
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
5
|
+
* @param {string} monthYearDate String of [Month Year] date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
7
8
|
*/
|
|
8
|
-
export declare function monthYearToDate(monthYearDate: string, settings?: IDateSettings):
|
|
9
|
+
export declare function monthYearToDate(monthYearDate: string, settings?: IDateSettings): IDate;
|
|
@@ -10,9 +10,9 @@ const getDefaultDateSettings_1 = require("../helpers/getDefaultDateSettings");
|
|
|
10
10
|
const validateDate_1 = require("../helpers/validateDate");
|
|
11
11
|
/**
|
|
12
12
|
* Transforms String Date from a [Month Year] format to Date object.
|
|
13
|
-
* @param monthYearDate String of [Month Year] date
|
|
14
|
-
* @param
|
|
15
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
13
|
+
* @param {string} monthYearDate String of [Month Year] date
|
|
14
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
15
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value
|
|
16
16
|
*/
|
|
17
17
|
function monthYearToDate(monthYearDate, settings) {
|
|
18
18
|
if ((0, isEmpty_1.isEmpty)(monthYearDate) ||
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Gets the ISO offset From the numeric offset (minutes)
|
|
3
|
-
* @param {number} offset the timezone offset
|
|
3
|
+
* @param {number | string} offset the timezone offset
|
|
4
4
|
* @returns {string} the offset in minutes
|
|
5
5
|
*/
|
|
6
6
|
export declare function numericOffsetToISO(offset: number | string, leadZeros?: boolean): string;
|
|
@@ -8,7 +8,7 @@ const isValidISOOffset_1 = require("../helpers/isValidISOOffset");
|
|
|
8
8
|
const ISOToNumericOffset_1 = require("./ISOToNumericOffset");
|
|
9
9
|
/**
|
|
10
10
|
* Gets the ISO offset From the numeric offset (minutes)
|
|
11
|
-
* @param {number} offset the timezone offset
|
|
11
|
+
* @param {number | string} offset the timezone offset
|
|
12
12
|
* @returns {string} the offset in minutes
|
|
13
13
|
*/
|
|
14
14
|
function numericOffsetToISO(offset, leadZeros = true) {
|
|
@@ -17,8 +17,6 @@ function numericOffsetToISO(offset, leadZeros = true) {
|
|
|
17
17
|
if (typeof newOffset === "string" && newOffset === "browser")
|
|
18
18
|
newOffset = -1 * new Date().getTimezoneOffset();
|
|
19
19
|
if (typeof newOffset === "string" && (0, isValidISOOffset_1.isValidISOOffset)(newOffset)) {
|
|
20
|
-
if (leadZeros)
|
|
21
|
-
return String(newOffset);
|
|
22
20
|
newOffset = (0, ISOToNumericOffset_1.ISOToNumericOffset)(newOffset);
|
|
23
21
|
}
|
|
24
22
|
if (typeof newOffset !== "number" && (0, isNaNV2_1.isNaNV2)(newOffset))
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transforms String Date from a [Quarter Year] format to Date object.
|
|
4
|
-
* @param quarterYearDate String of [Quarter Year] date
|
|
5
|
-
* @param
|
|
6
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
5
|
+
* @param {string} quarterYearDate String of [Quarter Year] date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
7
8
|
*/
|
|
8
|
-
export declare function quarterYearToDate(quarterYearDate: string, settings?: IDateSettings):
|
|
9
|
+
export declare function quarterYearToDate(quarterYearDate: string, settings?: IDateSettings): IDate;
|
|
@@ -10,9 +10,9 @@ const getDefaultDateSettings_1 = require("../helpers/getDefaultDateSettings");
|
|
|
10
10
|
const validateDate_1 = require("../helpers/validateDate");
|
|
11
11
|
/**
|
|
12
12
|
* Transforms String Date from a [Quarter Year] format to Date object.
|
|
13
|
-
* @param quarterYearDate String of [Quarter Year] date
|
|
14
|
-
* @param
|
|
15
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
13
|
+
* @param {string} quarterYearDate String of [Quarter Year] date
|
|
14
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
15
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
16
16
|
*/
|
|
17
17
|
function quarterYearToDate(quarterYearDate, settings) {
|
|
18
18
|
if ((0, isEmpty_1.isEmpty)(quarterYearDate) ||
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transforms String Date from a [Week Year] format to Date object.
|
|
4
|
-
* @param date String of [Week Year] date
|
|
5
|
-
* @param
|
|
6
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
5
|
+
* @param {string} date String of [Week Year] date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
7
8
|
*/
|
|
8
|
-
export declare function weekYearToDate(weekYear: string, settings?: IDateSettings):
|
|
9
|
+
export declare function weekYearToDate(weekYear: string, settings?: IDateSettings): IDate;
|
|
@@ -10,9 +10,9 @@ const getWeek_1 = require("../helpers/getWeek");
|
|
|
10
10
|
const validateDate_1 = require("../helpers/validateDate");
|
|
11
11
|
/**
|
|
12
12
|
* Transforms String Date from a [Week Year] format to Date object.
|
|
13
|
-
* @param date String of [Week Year] date
|
|
14
|
-
* @param
|
|
15
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
13
|
+
* @param {string} date String of [Week Year] date
|
|
14
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
15
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
16
16
|
*/
|
|
17
17
|
function weekYearToDate(weekYear, settings) {
|
|
18
18
|
if ((0, isEmpty_1.isEmpty)(weekYear) ||
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
3
|
/**
|
|
3
4
|
* Transforms String Date from a [Year] format to Date object.
|
|
4
|
-
* @param yearDate String of [Year] date
|
|
5
|
-
* @param
|
|
6
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
5
|
+
* @param {string} yearDate String of [Year] date
|
|
6
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
7
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
7
8
|
*/
|
|
8
|
-
export declare function yearToDate(yearDate: string, settings?: IDateSettings):
|
|
9
|
+
export declare function yearToDate(yearDate: string, settings?: IDateSettings): IDate;
|
|
@@ -9,9 +9,9 @@ const getDefaultDateSettings_1 = require("../helpers/getDefaultDateSettings");
|
|
|
9
9
|
const validateDate_1 = require("../helpers/validateDate");
|
|
10
10
|
/**
|
|
11
11
|
* Transforms String Date from a [Year] format to Date object.
|
|
12
|
-
* @param yearDate String of [Year] date
|
|
13
|
-
* @param
|
|
14
|
-
* @returns The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
12
|
+
* @param {string} yearDate String of [Year] date
|
|
13
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
14
|
+
* @returns {IDate} The date object or the date in milliseconds. If the argument is an unexpected date, the function will return the same value.
|
|
15
15
|
*/
|
|
16
16
|
function yearToDate(yearDate, settings) {
|
|
17
17
|
if ((0, isEmpty_1.isEmpty)(yearDate) ||
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ISO_8601_REGEX = void 0;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @example -12:00
|
|
6
|
+
* @example -01:00
|
|
7
|
+
* @example 00:00
|
|
8
|
+
* @example +00:00
|
|
9
|
+
* @example -00:00
|
|
10
|
+
* @example +05:00
|
|
11
|
+
* @example +12:00
|
|
12
|
+
* @example +13:59
|
|
13
|
+
* @example +14:00
|
|
14
|
+
*/
|
|
15
|
+
exports.ISO_8601_REGEX = /^(-(0[0-9]|1[0-2]):[0-5][0-9]|[+]?(0[0-9]|1[0-3]):[0-5][0-9]|\+14:00)?$/;
|
|
@@ -2,8 +2,8 @@ import { IDateFormat } from "../interfaces/IDateFormat";
|
|
|
2
2
|
/**
|
|
3
3
|
* Determines if the given date has tokens. The date is splitted depending on date format.
|
|
4
4
|
* Undefined date is returning false.
|
|
5
|
-
* @param date The string of the date. It may contain tokens.
|
|
6
|
-
* @param format The date format
|
|
7
|
-
* @returns true: include tokens; false: otherwise
|
|
5
|
+
* @param {string }date The string of the date. It may contain tokens.
|
|
6
|
+
* @param {IDateFormat} format The date format
|
|
7
|
+
* @returns {boolean} true: include tokens; false: otherwise
|
|
8
8
|
*/
|
|
9
9
|
export declare function areIncludedDateTokens(date: string, format?: IDateFormat): boolean;
|
|
@@ -8,9 +8,9 @@ const getSeparatorByDateFormat_1 = require("./getSeparatorByDateFormat");
|
|
|
8
8
|
/**
|
|
9
9
|
* Determines if the given date has tokens. The date is splitted depending on date format.
|
|
10
10
|
* Undefined date is returning false.
|
|
11
|
-
* @param date The string of the date. It may contain tokens.
|
|
12
|
-
* @param format The date format
|
|
13
|
-
* @returns true: include tokens; false: otherwise
|
|
11
|
+
* @param {string }date The string of the date. It may contain tokens.
|
|
12
|
+
* @param {IDateFormat} format The date format
|
|
13
|
+
* @returns {boolean} true: include tokens; false: otherwise
|
|
14
14
|
*/
|
|
15
15
|
function areIncludedDateTokens(date, format = DATE_FORMAT_1.DATE_FORMAT.DAY) {
|
|
16
16
|
let hasTokens = false;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IDateFormat } from "../interfaces/IDateFormat";
|
|
2
2
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
3
|
+
import { IDate } from "../interfaces/IDate";
|
|
3
4
|
/**
|
|
4
5
|
* Gets a Date Object instance by a Date format
|
|
5
|
-
* @param date String with a formatted date
|
|
6
|
-
* @param format The date format
|
|
7
|
-
* @param
|
|
8
|
-
* @returns a Date object, milisecond time or the same value if date format does not match.
|
|
6
|
+
* @param {string} date String with a formatted date
|
|
7
|
+
* @param {IDateFormat} format The date format
|
|
8
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
9
|
+
* @returns {IDate} a Date object, milisecond time or the same value if date format does not match.
|
|
9
10
|
*/
|
|
10
|
-
export declare function getDateByDateFormat(date: string, format: IDateFormat, settings?: IDateSettings):
|
|
11
|
+
export declare function getDateByDateFormat(date: string, format: IDateFormat, settings?: IDateSettings): IDate;
|
|
@@ -9,10 +9,10 @@ const weekYearToDate_1 = require("../adapters/weekYearToDate");
|
|
|
9
9
|
const mdyDateToDate_1 = require("../adapters/mdyDateToDate");
|
|
10
10
|
/**
|
|
11
11
|
* Gets a Date Object instance by a Date format
|
|
12
|
-
* @param date String with a formatted date
|
|
13
|
-
* @param format The date format
|
|
14
|
-
* @param
|
|
15
|
-
* @returns a Date object, milisecond time or the same value if date format does not match.
|
|
12
|
+
* @param {string} date String with a formatted date
|
|
13
|
+
* @param {IDateFormat} format The date format
|
|
14
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
15
|
+
* @returns {IDate} a Date object, milisecond time or the same value if date format does not match.
|
|
16
16
|
*/
|
|
17
17
|
function getDateByDateFormat(date, format, settings) {
|
|
18
18
|
switch (format) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IDTimezone } from "../interfaces/IDTimezone";
|
|
2
|
+
import { IDate } from "../interfaces/IDate";
|
|
2
3
|
/**
|
|
3
4
|
* Gets a date value in the given timezone
|
|
4
|
-
* @param {
|
|
5
|
+
* @param {IDate} date the date
|
|
5
6
|
* @param {IDTimezone} timezone the timezone object
|
|
6
|
-
* @returns {
|
|
7
|
+
* @returns {IDate} A transformed value
|
|
7
8
|
*/
|
|
8
|
-
export declare function getDateByTimezone(date:
|
|
9
|
+
export declare function getDateByTimezone(date: IDate, timezone: IDTimezone): IDate;
|
|
@@ -9,9 +9,9 @@ const isValidPotentialDate_1 = require("./isValidPotentialDate");
|
|
|
9
9
|
const validateDate_1 = require("./validateDate");
|
|
10
10
|
/**
|
|
11
11
|
* Gets a date value in the given timezone
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {IDate} date the date
|
|
13
13
|
* @param {IDTimezone} timezone the timezone object
|
|
14
|
-
* @returns {
|
|
14
|
+
* @returns {IDate} A transformed value
|
|
15
15
|
*/
|
|
16
16
|
function getDateByTimezone(date, timezone) {
|
|
17
17
|
const defaultTimezone = (0, getTimezoneObject_1.getTimezoneObject)(timezone);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { IDTimezoneOffset } from "../interfaces/IDTimezoneOffset";
|
|
2
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
3
|
/**
|
|
2
4
|
* Gets a Date with the given offset of the Timezone.
|
|
3
5
|
* No given an offset the default is going to be set by the browser
|
|
4
|
-
* @param date String, object or millisencond number of the date
|
|
5
|
-
* @
|
|
6
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
7
|
+
* @param {IDTimezoneOffset} offset the timezone offset
|
|
8
|
+
* @returns {IDate} the updated Date object
|
|
6
9
|
*/
|
|
7
|
-
export declare function getDateByTimezoneOffset(date:
|
|
10
|
+
export declare function getDateByTimezoneOffset(date: IDate, offset?: IDTimezoneOffset): IDate;
|
|
@@ -12,8 +12,9 @@ const validateDate_1 = require("./validateDate");
|
|
|
12
12
|
/**
|
|
13
13
|
* Gets a Date with the given offset of the Timezone.
|
|
14
14
|
* No given an offset the default is going to be set by the browser
|
|
15
|
-
* @param date String, object or millisencond number of the date
|
|
16
|
-
* @
|
|
15
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
16
|
+
* @param {IDTimezoneOffset} offset the timezone offset
|
|
17
|
+
* @returns {IDate} the updated Date object
|
|
17
18
|
*/
|
|
18
19
|
function getDateByTimezoneOffset(date, offset) {
|
|
19
20
|
if (!(0, isValidPotentialDate_1.isValidPotentialDate)(date) ||
|
|
@@ -2,7 +2,7 @@ import { IColumnPropertyType } from "../../columns/interfaces/IColumnPropertyTyp
|
|
|
2
2
|
import { IDateFormat } from "../interfaces/IDateFormat";
|
|
3
3
|
/**
|
|
4
4
|
* Gets the date format by the given property
|
|
5
|
-
* @param property The Column Property
|
|
6
|
-
* @returns The date format
|
|
5
|
+
* @param {IColumnPropertyType} property The Column Property
|
|
6
|
+
* @returns {IDateFormat} The date format
|
|
7
7
|
*/
|
|
8
8
|
export declare function getDateFormatByProperty(property: IColumnPropertyType): IDateFormat;
|
|
@@ -4,8 +4,8 @@ exports.getDateFormatByProperty = void 0;
|
|
|
4
4
|
const DATE_FORMAT_BY_PROPERTY_1 = require("../constants/DATE_FORMAT_BY_PROPERTY");
|
|
5
5
|
/**
|
|
6
6
|
* Gets the date format by the given property
|
|
7
|
-
* @param property The Column Property
|
|
8
|
-
* @returns The date format
|
|
7
|
+
* @param {IColumnPropertyType} property The Column Property
|
|
8
|
+
* @returns {IDateFormat} The date format
|
|
9
9
|
*/
|
|
10
10
|
function getDateFormatByProperty(property) {
|
|
11
11
|
return DATE_FORMAT_BY_PROPERTY_1.DATE_FORMAT_BY_PROPERTY[property];
|