@qrvey/utils 1.11.0-0 → 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 -1
- 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 +4 -3
- 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/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 +1 -1
- package/dist/cjs/dates/helpers/isValidTimezoneOffset.js +15 -4
- 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/getVerboseFilters.d.ts +1 -1
- package/dist/cjs/filters/helpers/common/getVerboseFilters.js +64 -27
- package/dist/cjs/filters/helpers/settings/getFilterSettings.js +1 -6
- 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 -1
- 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 +4 -3
- 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/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 +1 -1
- package/dist/dates/helpers/isValidTimezoneOffset.js +15 -4
- 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/getVerboseFilters.d.ts +1 -1
- package/dist/filters/helpers/common/getVerboseFilters.js +63 -26
- package/dist/filters/helpers/settings/getFilterSettings.js +1 -6
- 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
|
@@ -8,7 +8,7 @@ const DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT_1 = require("../constants/DATE_REG
|
|
|
8
8
|
* Gets an array of regular expressions by the given date format.
|
|
9
9
|
* Day format is the default date format
|
|
10
10
|
* @param {IDateFormat} dateFormat an string of the format
|
|
11
|
-
* @returns an array of regular expressions
|
|
11
|
+
* @returns {string[]} an array of regular expressions
|
|
12
12
|
*/
|
|
13
13
|
function getDateFormatRegularExpressionInArray(dateFormat = DATE_FORMAT_1.DATE_FORMAT.DAY) {
|
|
14
14
|
const defaultRegularExpression = DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT_1.DATE_REGULAR_EXPRESSION_ARRAY_BY_FORMAT[DATE_FORMAT_1.DATE_FORMAT.DAY];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
2
2
|
/**
|
|
3
3
|
* Gets the default properties for Date Settings object
|
|
4
|
-
* @param settings the
|
|
5
|
-
* @returns a new object with the date settings.
|
|
4
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
5
|
+
* @returns {IDateSettings} a new object with the date settings.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getDefaultDateSettings(settings: IDateSettings): IDateSettings;
|
|
@@ -4,8 +4,8 @@ exports.getDefaultDateSettings = void 0;
|
|
|
4
4
|
const getTimezoneObject_1 = require("./getTimezoneObject");
|
|
5
5
|
/**
|
|
6
6
|
* Gets the default properties for Date Settings object
|
|
7
|
-
* @param settings the
|
|
8
|
-
* @returns a new object with the date settings.
|
|
7
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
8
|
+
* @returns {IDateSettings} a new object with the date settings.
|
|
9
9
|
*/
|
|
10
10
|
function getDefaultDateSettings(settings) {
|
|
11
11
|
var _a;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
import { IDateFormat } from "../interfaces/IDateFormat";
|
|
2
3
|
import { IDateSettings } from "../interfaces/IDateSettings";
|
|
3
4
|
/**
|
|
4
5
|
* A Date object, string or millisecond number are gotten in order to convert it in an formatted string date
|
|
5
6
|
* - Some strings are valid
|
|
6
|
-
* @param date String with a formatted date
|
|
7
|
-
* @param format The date format
|
|
8
|
-
* @
|
|
7
|
+
* @param {IDate} date String with a formatted date
|
|
8
|
+
* @param {IDateFormat} format The date format
|
|
9
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
10
|
+
* @returns {IDate} a formmatted date or the same value if format does not match
|
|
9
11
|
*/
|
|
10
|
-
export declare function getFormattedDateByFormat(date:
|
|
12
|
+
export declare function getFormattedDateByFormat(date: IDate, format: IDateFormat, settings?: IDateSettings): IDate;
|
|
@@ -10,9 +10,10 @@ const DATE_FORMAT_1 = require("../constants/DATE_FORMAT");
|
|
|
10
10
|
/**
|
|
11
11
|
* A Date object, string or millisecond number are gotten in order to convert it in an formatted string date
|
|
12
12
|
* - Some strings are valid
|
|
13
|
-
* @param date String with a formatted date
|
|
14
|
-
* @param format The date format
|
|
15
|
-
* @
|
|
13
|
+
* @param {IDate} date String with a formatted date
|
|
14
|
+
* @param {IDateFormat} format The date format
|
|
15
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
16
|
+
* @returns {IDate} a formmatted date or the same value if format does not match
|
|
16
17
|
*/
|
|
17
18
|
function getFormattedDateByFormat(date, format, settings) {
|
|
18
19
|
switch (format) {
|
|
@@ -2,6 +2,6 @@ import { IDateFormat } from "../interfaces/IDateFormat";
|
|
|
2
2
|
/**
|
|
3
3
|
* Gets the separator of the date format
|
|
4
4
|
* @param {IDateFormat} format the date format
|
|
5
|
-
* @returns a separator string
|
|
5
|
+
* @returns {string} a separator string
|
|
6
6
|
*/
|
|
7
7
|
export declare function getSeparatorByDateFormat(format?: IDateFormat): string;
|
|
@@ -5,7 +5,7 @@ const DATE_FORMAT_1 = require("../constants/DATE_FORMAT");
|
|
|
5
5
|
/**
|
|
6
6
|
* Gets the separator of the date format
|
|
7
7
|
* @param {IDateFormat} format the date format
|
|
8
|
-
* @returns a separator string
|
|
8
|
+
* @returns {string} a separator string
|
|
9
9
|
*/
|
|
10
10
|
function getSeparatorByDateFormat(format = DATE_FORMAT_1.DATE_FORMAT.DAY) {
|
|
11
11
|
return format === DATE_FORMAT_1.DATE_FORMAT.DAY ? "/" : " ";
|
|
@@ -6,6 +6,6 @@ import { IDTimezone } from "../interfaces/IDTimezone";
|
|
|
6
6
|
* - In any case, the offset is prioritized to override other properties.
|
|
7
7
|
* @param {IDTimezone} timezone the timezone object
|
|
8
8
|
* @param {IModel | IDataset} model the info of the dataset (model)
|
|
9
|
-
* @returns a new timezone object
|
|
9
|
+
* @returns {IDTimezone} a new timezone object
|
|
10
10
|
*/
|
|
11
11
|
export declare function getTimezoneObject(timezone: IDTimezone, model?: IModel | IDataset): IDTimezone;
|
|
@@ -13,7 +13,7 @@ const isValidTimezoneOffset_1 = require("./isValidTimezoneOffset");
|
|
|
13
13
|
* - In any case, the offset is prioritized to override other properties.
|
|
14
14
|
* @param {IDTimezone} timezone the timezone object
|
|
15
15
|
* @param {IModel | IDataset} model the info of the dataset (model)
|
|
16
|
-
* @returns a new timezone object
|
|
16
|
+
* @returns {IDTimezone} a new timezone object
|
|
17
17
|
*/
|
|
18
18
|
function getTimezoneObject(timezone, model) {
|
|
19
19
|
const offset = getOffset(timezone, model);
|
|
@@ -68,8 +68,9 @@ function getType(timezone, model, offset) {
|
|
|
68
68
|
if (!(0, isEmpty_1.isEmpty)(timezone === null || timezone === void 0 ? void 0 : timezone.type)) {
|
|
69
69
|
type = timezone.type;
|
|
70
70
|
}
|
|
71
|
-
else if (!(0, isEmpty_1.isEmpty)(timezone === null || timezone === void 0 ? void 0 : timezone.offset)
|
|
72
|
-
|
|
71
|
+
else if (!(0, isEmpty_1.isEmpty)(timezone === null || timezone === void 0 ? void 0 : timezone.offset) &&
|
|
72
|
+
(0, isValidTimezoneOffset_1.isValidTimezoneOffset)(timezone.offset)) {
|
|
73
|
+
type = getTypeByOffset(timezone.offset);
|
|
73
74
|
}
|
|
74
75
|
else if (!(0, isEmpty_1.isEmpty)((_a = model === null || model === void 0 ? void 0 : model.timezone) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
75
76
|
type = model.timezone.type;
|
|
@@ -2,6 +2,7 @@ import { IDTimezone } from "../interfaces/IDTimezone";
|
|
|
2
2
|
/**
|
|
3
3
|
* Gets the UTC format dependeing on the given offset
|
|
4
4
|
* @param {IDTimezone} timezone the timezone object
|
|
5
|
+
* @param {boolean} minified Flag to reduce the Zeros
|
|
5
6
|
* @returns {string} an string with the UTC format
|
|
6
7
|
*/
|
|
7
8
|
export declare function getUTCFormatByOffset(timezone: IDTimezone, minified?: boolean): string;
|
|
@@ -6,6 +6,7 @@ const numericOffsetToISO_1 = require("../adapters/numericOffsetToISO");
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets the UTC format dependeing on the given offset
|
|
8
8
|
* @param {IDTimezone} timezone the timezone object
|
|
9
|
+
* @param {boolean} minified Flag to reduce the Zeros
|
|
9
10
|
* @returns {string} an string with the UTC format
|
|
10
11
|
*/
|
|
11
12
|
function getUTCFormatByOffset(timezone, minified = false) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Gets the week number of the year
|
|
3
3
|
* Additionally, the month and the year
|
|
4
4
|
* @param {Date} date the date object
|
|
5
|
-
* @returns an object with the week, month and year or undefined if the date is not valid.
|
|
5
|
+
* @returns {IDateWeek} an object with the week, month and year or undefined if the date is not valid.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getWeek(date: Date): IDateWeek;
|
|
8
8
|
interface IDateWeek {
|
|
@@ -6,7 +6,7 @@ const isValidDateObject_1 = require("./isValidDateObject");
|
|
|
6
6
|
* Gets the week number of the year
|
|
7
7
|
* Additionally, the month and the year
|
|
8
8
|
* @param {Date} date the date object
|
|
9
|
-
* @returns an object with the week, month and year or undefined if the date is not valid.
|
|
9
|
+
* @returns {IDateWeek} an object with the week, month and year or undefined if the date is not valid.
|
|
10
10
|
*/
|
|
11
11
|
function getWeek(date) {
|
|
12
12
|
if (!(0, isValidDateObject_1.isValidDateObject)(date))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* If the date is a valid Date object, return true, otherwise return false.
|
|
3
3
|
* @param {Date} date - The date object to check.
|
|
4
|
-
* @returns
|
|
4
|
+
* @returns {boolean} True: The Date object is valid
|
|
5
5
|
*/
|
|
6
6
|
export declare function isValidDateObject(date: Date): boolean;
|
|
@@ -4,7 +4,7 @@ exports.isValidDateObject = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* If the date is a valid Date object, return true, otherwise return false.
|
|
6
6
|
* @param {Date} date - The date object to check.
|
|
7
|
-
* @returns
|
|
7
|
+
* @returns {boolean} True: The Date object is valid
|
|
8
8
|
*/
|
|
9
9
|
function isValidDateObject(date) {
|
|
10
10
|
return date instanceof Date && !isNaN(date.getTime());
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IDTimezoneOffset } from "../interfaces/IDTimezoneOffset";
|
|
1
2
|
/**
|
|
2
3
|
* Validate if offset uses a valid ISO 8601 offset specification
|
|
3
4
|
* - If the given offset is a numeric, returns an invalid flag.
|
|
4
|
-
* @param {
|
|
5
|
+
* @param {IDTimezoneOffset} offset the timezone offset
|
|
5
6
|
* @returns {boolean} true if the given offset is valid
|
|
6
7
|
*/
|
|
7
|
-
export declare function isValidISOOffset(offset:
|
|
8
|
+
export declare function isValidISOOffset(offset: IDTimezoneOffset): boolean;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidISOOffset = void 0;
|
|
4
|
+
const isEmpty_1 = require("../../general/mix/isEmpty");
|
|
4
5
|
const ISO_8601_REGEX_1 = require("../constants/ISO_8601_REGEX");
|
|
5
6
|
/**
|
|
6
7
|
* Validate if offset uses a valid ISO 8601 offset specification
|
|
7
8
|
* - If the given offset is a numeric, returns an invalid flag.
|
|
8
|
-
* @param {
|
|
9
|
+
* @param {IDTimezoneOffset} offset the timezone offset
|
|
9
10
|
* @returns {boolean} true if the given offset is valid
|
|
10
11
|
*/
|
|
11
12
|
function isValidISOOffset(offset) {
|
|
12
|
-
if (typeof offset !== "string")
|
|
13
|
+
if ((0, isEmpty_1.isEmpty)(offset) || typeof offset !== "string")
|
|
13
14
|
return false;
|
|
14
15
|
const newOffset = (offset || "").trim();
|
|
15
16
|
return ISO_8601_REGEX_1.ISO_8601_REGEX.test(newOffset);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IDate } from "../interfaces/IDate";
|
|
1
2
|
/**
|
|
2
3
|
* Checks if the given date is allowed to continue the process for adapting dates
|
|
3
4
|
* - If the string is a token or a combination of tokens is not valid
|
|
4
|
-
* @param {
|
|
5
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
5
6
|
* @returns true: the date is valid.
|
|
6
7
|
*/
|
|
7
|
-
export declare function isValidPotentialDate(date:
|
|
8
|
+
export declare function isValidPotentialDate(date: IDate): boolean;
|
|
@@ -7,7 +7,7 @@ const areIncludedDateTokens_1 = require("./areIncludedDateTokens");
|
|
|
7
7
|
/**
|
|
8
8
|
* Checks if the given date is allowed to continue the process for adapting dates
|
|
9
9
|
* - If the string is a token or a combination of tokens is not valid
|
|
10
|
-
* @param {
|
|
10
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
11
11
|
* @returns true: the date is valid.
|
|
12
12
|
*/
|
|
13
13
|
function isValidPotentialDate(date) {
|
|
@@ -16,12 +16,27 @@ function isValidPotentialDate(date) {
|
|
|
16
16
|
(isDateInstance(date) || isStringDate(date) || typeof date === "number"));
|
|
17
17
|
}
|
|
18
18
|
exports.isValidPotentialDate = isValidPotentialDate;
|
|
19
|
+
/**
|
|
20
|
+
* Validates if the given date has tokens
|
|
21
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
22
|
+
* @returns {boolean} true: the date has tokens
|
|
23
|
+
*/
|
|
19
24
|
function includingDateTokens(date) {
|
|
20
25
|
return DATE_FORMATS_1.DATE_FORMATS.some((dateFormat) => (0, areIncludedDateTokens_1.areIncludedDateTokens)(date, dateFormat));
|
|
21
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Validates if the given date is a date instance
|
|
29
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
30
|
+
* @returns {boolean} true: the date is a date instance
|
|
31
|
+
*/
|
|
22
32
|
function isDateInstance(date) {
|
|
23
33
|
return date instanceof Date && !isNaN(date);
|
|
24
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Validates if the given date is a string date
|
|
37
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
38
|
+
* @returns {boolean} true: the date is a string date
|
|
39
|
+
*/
|
|
25
40
|
function isStringDate(date) {
|
|
26
41
|
return (typeof date === "string" && new Date(date).toString() !== "Invalid Date");
|
|
27
42
|
}
|
|
@@ -2,6 +2,6 @@ import { IDTimezoneOffset } from "../interfaces/IDTimezoneOffset";
|
|
|
2
2
|
/**
|
|
3
3
|
* Validates if the given param is a valid timezone offset
|
|
4
4
|
* @param {IDTimezoneOffset} offset the timezone offset
|
|
5
|
-
* @returns true: is valid.
|
|
5
|
+
* @returns {boolean} true: is valid timezone offset.
|
|
6
6
|
*/
|
|
7
7
|
export declare function isValidTimezoneOffset(offset: IDTimezoneOffset): boolean;
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidTimezoneOffset = void 0;
|
|
4
|
-
const
|
|
4
|
+
const isNaNV2_1 = require("../../general/mix/isNaNV2");
|
|
5
|
+
const ISOToNumericOffset_1 = require("../adapters/ISOToNumericOffset");
|
|
5
6
|
const isValidISOOffset_1 = require("./isValidISOOffset");
|
|
6
7
|
/**
|
|
7
8
|
* Validates if the given param is a valid timezone offset
|
|
8
9
|
* @param {IDTimezoneOffset} offset the timezone offset
|
|
9
|
-
* @returns true: is valid.
|
|
10
|
+
* @returns {boolean} true: is valid timezone offset.
|
|
10
11
|
*/
|
|
11
12
|
function isValidTimezoneOffset(offset) {
|
|
12
13
|
if (typeof offset === "string") {
|
|
13
|
-
return offset === "browser" ||
|
|
14
|
+
return (offset === "browser" ||
|
|
15
|
+
((0, isValidISOOffset_1.isValidISOOffset)(offset) && isValidOffsetRange(offset)));
|
|
14
16
|
}
|
|
15
17
|
if (typeof offset === "number") {
|
|
16
|
-
return !(0,
|
|
18
|
+
return !(0, isNaNV2_1.isNaNV2)(offset) && isValidOffsetRange(offset);
|
|
17
19
|
}
|
|
18
20
|
return false;
|
|
19
21
|
}
|
|
20
22
|
exports.isValidTimezoneOffset = isValidTimezoneOffset;
|
|
23
|
+
/**
|
|
24
|
+
* Validates if the given offset is in the timezone range
|
|
25
|
+
* @param {IDTimezoneOffset} offset the timezone offset
|
|
26
|
+
* @returns {boolean} true: the offset is in the timezone range
|
|
27
|
+
*/
|
|
28
|
+
function isValidOffsetRange(offset) {
|
|
29
|
+
const numericOffset = (0, ISOToNumericOffset_1.ISOToNumericOffset)(offset);
|
|
30
|
+
return -720 <= numericOffset && numericOffset <= 840;
|
|
31
|
+
}
|
|
@@ -4,8 +4,8 @@ import { IDateFormat } from "../interfaces/IDateFormat";
|
|
|
4
4
|
* - If the string is a token label, the function lets it pass.
|
|
5
5
|
* - Otherwise depends of the format
|
|
6
6
|
* - Some escenarios the string is a mix of token labels and dates
|
|
7
|
-
* @param date String of date
|
|
8
|
-
* @param format String of the format to validate
|
|
9
|
-
* @returns True if it is valid or not. Undefined if date is undefined
|
|
7
|
+
* @param {string} date String of date
|
|
8
|
+
* @param {IDateFormat} format String of the format to validate
|
|
9
|
+
* @returns {boolean} True if it is valid or not. Undefined if date is undefined
|
|
10
10
|
*/
|
|
11
11
|
export declare function validateDate(date: string, format?: IDateFormat): boolean;
|
|
@@ -11,9 +11,9 @@ const getSeparatorByDateFormat_1 = require("./getSeparatorByDateFormat");
|
|
|
11
11
|
* - If the string is a token label, the function lets it pass.
|
|
12
12
|
* - Otherwise depends of the format
|
|
13
13
|
* - Some escenarios the string is a mix of token labels and dates
|
|
14
|
-
* @param date String of date
|
|
15
|
-
* @param format String of the format to validate
|
|
16
|
-
* @returns True if it is valid or not. Undefined if date is undefined
|
|
14
|
+
* @param {string} date String of date
|
|
15
|
+
* @param {IDateFormat} format String of the format to validate
|
|
16
|
+
* @returns {boolean} True if it is valid or not. Undefined if date is undefined
|
|
17
17
|
*/
|
|
18
18
|
function validateDate(date, format = DATE_FORMAT_1.DATE_FORMAT.DAY) {
|
|
19
19
|
if ((0, isEmpty_1.isEmpty)(date) || typeof date !== "string")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type IDate = Date | string | number;
|
|
@@ -3,7 +3,7 @@ import { IFUData } from "../../interfaces/ui/IFUData";
|
|
|
3
3
|
/**
|
|
4
4
|
* Gets an string that describes the filter data content
|
|
5
5
|
* @param {IFUData} filters The filters object to verbose
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {IFFGetVerboseFilters} settings the settings for the function
|
|
7
7
|
* @returns A string
|
|
8
8
|
*/
|
|
9
9
|
export declare function getVerboseFilters(filterData: IFUData, settings?: IFFGetVerboseFilters): string;
|
|
@@ -6,7 +6,7 @@ const getVerboseFilterScopes_1 = require("./getVerboseFilterScopes");
|
|
|
6
6
|
/**
|
|
7
7
|
* Gets an string that describes the filter data content
|
|
8
8
|
* @param {IFUData} filters The filters object to verbose
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {IFFGetVerboseFilters} settings the settings for the function
|
|
10
10
|
* @returns A string
|
|
11
11
|
*/
|
|
12
12
|
function getVerboseFilters(filterData, settings) {
|
|
@@ -16,39 +16,76 @@ function getVerboseFilters(filterData, settings) {
|
|
|
16
16
|
}
|
|
17
17
|
exports.getVerboseFilters = getVerboseFilters;
|
|
18
18
|
function getVerboseFiltersSettings(settings) {
|
|
19
|
-
var _a
|
|
19
|
+
var _a;
|
|
20
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getVerboseFilterDatasetsSettings(settings)), getVerboseFilterFiltersSettings(settings)), getVerboseFilterScopesSettings(settings)), getVerboseFilterValuesSettings(settings)), { chartLabelDisplayed: (_a = settings === null || settings === void 0 ? void 0 : settings.chartLabelDisplayed) !== null && _a !== void 0 ? _a : true, translate: settings === null || settings === void 0 ? void 0 : settings.translate });
|
|
21
|
+
}
|
|
22
|
+
exports.getVerboseFiltersSettings = getVerboseFiltersSettings;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the dataset settings by the given settings
|
|
25
|
+
* @param {IFFGetVerboseFilters} settings the settings for the function
|
|
26
|
+
* @returns the dataset settings
|
|
27
|
+
*/
|
|
28
|
+
function getVerboseFilterDatasetsSettings(settings) {
|
|
29
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20
30
|
return {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
datasetTitleNewLine: (_e = settings === null || settings === void 0 ? void 0 : settings.datasetTitleNewLine) !== null && _e !== void 0 ? _e : false,
|
|
31
|
+
datasetDisplayDisplayed: (_a = settings === null || settings === void 0 ? void 0 : settings.datasetDisplayDisplayed) !== null && _a !== void 0 ? _a : true,
|
|
32
|
+
datasetEnableDisplayed: (_b = settings === null || settings === void 0 ? void 0 : settings.datasetEnableDisplayed) !== null && _b !== void 0 ? _b : true,
|
|
33
|
+
datasetTitleDisplayed: (_c = settings === null || settings === void 0 ? void 0 : settings.datasetTitleDisplayed) !== null && _c !== void 0 ? _c : true,
|
|
34
|
+
datasetTitleNewLine: (_d = settings === null || settings === void 0 ? void 0 : settings.datasetTitleNewLine) !== null && _d !== void 0 ? _d : false,
|
|
26
35
|
datasetTitleSeparator: (settings === null || settings === void 0 ? void 0 : settings.datasetTitleSeparator) || ": ",
|
|
27
|
-
datasetNewLine: (
|
|
28
|
-
datasetOperatorDisplayed: (
|
|
36
|
+
datasetNewLine: (_e = settings === null || settings === void 0 ? void 0 : settings.datasetNewLine) !== null && _e !== void 0 ? _e : false,
|
|
37
|
+
datasetOperatorDisplayed: (_f = settings === null || settings === void 0 ? void 0 : settings.datasetOperatorDisplayed) !== null && _f !== void 0 ? _f : false,
|
|
29
38
|
datasetSeparator: (settings === null || settings === void 0 ? void 0 : settings.datasetSeparator) || ", ",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the filter settings by the given settings
|
|
43
|
+
* @param {IFFGetVerboseFilters} settings the settings for the function
|
|
44
|
+
* @returns the filter settings
|
|
45
|
+
*/
|
|
46
|
+
function getVerboseFilterFiltersSettings(settings) {
|
|
47
|
+
var _a, _b, _c, _d, _e, _f;
|
|
48
|
+
return {
|
|
49
|
+
filterDisplayDisplayed: (_a = settings === null || settings === void 0 ? void 0 : settings.filterDisplayDisplayed) !== null && _a !== void 0 ? _a : true,
|
|
50
|
+
filterEnableDisplayed: (_b = settings === null || settings === void 0 ? void 0 : settings.filterEnableDisplayed) !== null && _b !== void 0 ? _b : true,
|
|
51
|
+
filterTitleDisplayed: (_c = settings === null || settings === void 0 ? void 0 : settings.filterTitleDisplayed) !== null && _c !== void 0 ? _c : true,
|
|
52
|
+
filterTitleNewLine: (_d = settings === null || settings === void 0 ? void 0 : settings.filterTitleNewLine) !== null && _d !== void 0 ? _d : false,
|
|
34
53
|
filterTitleSeparator: (settings === null || settings === void 0 ? void 0 : settings.filterTitleSeparator) || ": ",
|
|
35
|
-
filterNewLine: (
|
|
36
|
-
filterOperatorDisplayed: (
|
|
54
|
+
filterNewLine: (_e = settings === null || settings === void 0 ? void 0 : settings.filterNewLine) !== null && _e !== void 0 ? _e : false,
|
|
55
|
+
filterOperatorDisplayed: (_f = settings === null || settings === void 0 ? void 0 : settings.filterOperatorDisplayed) !== null && _f !== void 0 ? _f : false,
|
|
37
56
|
filterSeparator: (settings === null || settings === void 0 ? void 0 : settings.filterSeparator) || ", ",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Gets the scope settings by the given settings
|
|
61
|
+
* @param {IFFGetVerboseFilters} settings the settings for the function
|
|
62
|
+
* @returns the scope settings
|
|
63
|
+
*/
|
|
64
|
+
function getVerboseFilterScopesSettings(settings) {
|
|
65
|
+
var _a, _b, _c, _d, _e, _f;
|
|
66
|
+
return {
|
|
67
|
+
scopeDisplayDisplayed: (_a = settings === null || settings === void 0 ? void 0 : settings.scopeDisplayDisplayed) !== null && _a !== void 0 ? _a : true,
|
|
68
|
+
scopeEnableDisplayed: (_b = settings === null || settings === void 0 ? void 0 : settings.scopeEnableDisplayed) !== null && _b !== void 0 ? _b : true,
|
|
69
|
+
scopeTitleDisplayed: (_c = settings === null || settings === void 0 ? void 0 : settings.scopeTitleDisplayed) !== null && _c !== void 0 ? _c : true,
|
|
70
|
+
scopeTitleNewLine: (_d = settings === null || settings === void 0 ? void 0 : settings.scopeTitleNewLine) !== null && _d !== void 0 ? _d : false,
|
|
42
71
|
scopeTitleSeparator: (settings === null || settings === void 0 ? void 0 : settings.scopeTitleSeparator) || ": ",
|
|
43
|
-
scopeNewLine: (
|
|
44
|
-
scopeOperatorDisplayed: (
|
|
72
|
+
scopeNewLine: (_e = settings === null || settings === void 0 ? void 0 : settings.scopeNewLine) !== null && _e !== void 0 ? _e : false,
|
|
73
|
+
scopeOperatorDisplayed: (_f = settings === null || settings === void 0 ? void 0 : settings.scopeOperatorDisplayed) !== null && _f !== void 0 ? _f : false,
|
|
45
74
|
scopeSeparator: (settings === null || settings === void 0 ? void 0 : settings.scopeSeparator) || ", ",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets the value settings by the given settings
|
|
79
|
+
* @param {IFFGetVerboseFilters} settings the settings for the function
|
|
80
|
+
* @returns the value settings
|
|
81
|
+
*/
|
|
82
|
+
function getVerboseFilterValuesSettings(settings) {
|
|
83
|
+
var _a, _b, _c, _d;
|
|
84
|
+
return {
|
|
85
|
+
valueDisplayDisplayed: (_a = settings === null || settings === void 0 ? void 0 : settings.valueDisplayDisplayed) !== null && _a !== void 0 ? _a : true,
|
|
86
|
+
valueEnableDisplayed: (_b = settings === null || settings === void 0 ? void 0 : settings.valueEnableDisplayed) !== null && _b !== void 0 ? _b : true,
|
|
87
|
+
valueNewLine: (_c = settings === null || settings === void 0 ? void 0 : settings.valueNewLine) !== null && _c !== void 0 ? _c : false,
|
|
88
|
+
valueOperatorDisplayed: (_d = settings === null || settings === void 0 ? void 0 : settings.valueOperatorDisplayed) !== null && _d !== void 0 ? _d : false,
|
|
50
89
|
valueSeparator: (settings === null || settings === void 0 ? void 0 : settings.valueSeparator) || ", ",
|
|
51
|
-
translate: settings === null || settings === void 0 ? void 0 : settings.translate,
|
|
52
90
|
};
|
|
53
91
|
}
|
|
54
|
-
exports.getVerboseFiltersSettings = getVerboseFiltersSettings;
|
|
@@ -265,12 +265,7 @@ function getFilterSettingsByDefaultWithOneAdditionalScope(settings) {
|
|
|
265
265
|
* @returns a new filter settings object
|
|
266
266
|
*/
|
|
267
267
|
function getFilterSettingsByOnlyPanelScope(settings) {
|
|
268
|
-
const newSettings =
|
|
269
|
-
chartBuilder: {
|
|
270
|
-
addFilterDisplayed: false,
|
|
271
|
-
filterSectionDisplayed: false,
|
|
272
|
-
},
|
|
273
|
-
};
|
|
268
|
+
const newSettings = getFilterSettingsByNoDefaultScope(settings);
|
|
274
269
|
return (0, mergeDeep_1.mergeDeep)(settings, newSettings);
|
|
275
270
|
}
|
|
276
271
|
/**
|
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./bucket_builder"), exports);
|
|
18
18
|
__exportStar(require("./calendar"), exports);
|
|
19
19
|
__exportStar(require("./chart_builder"), exports);
|
|
20
|
-
__exportStar(require("./columns"), exports);
|
|
21
20
|
__exportStar(require("./common"), exports);
|
|
22
21
|
__exportStar(require("./cross_tabs"), exports);
|
|
23
22
|
__exportStar(require("./dashboard"), exports);
|
|
@@ -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;
|
|
@@ -3,7 +3,7 @@ import { getSign } from "../../general/numeric/getSign";
|
|
|
3
3
|
import { isValidISOOffset } from "../helpers/isValidISOOffset";
|
|
4
4
|
/**
|
|
5
5
|
* Gets the numeric offset (minutes) from the ISO offset (string)
|
|
6
|
-
* @param {string} offset the timezone offset
|
|
6
|
+
* @param {number | string} offset the timezone offset
|
|
7
7
|
* @returns {number} the offset in minutes
|
|
8
8
|
*/
|
|
9
9
|
export 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;
|
|
@@ -4,9 +4,9 @@ import { isValidDateObject } from "../helpers/isValidDateObject";
|
|
|
4
4
|
import { isValidPotentialDate } from "../helpers/isValidPotentialDate";
|
|
5
5
|
/**
|
|
6
6
|
* * Transform a Date to [HH:mm:ss] date format.
|
|
7
|
-
* @param date String, object or millisencond number of the date
|
|
8
|
-
* @param settings the settings of the dateToHms function
|
|
9
|
-
* @returns string of [HH:mm:ss] date format
|
|
7
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
8
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
9
|
+
* @returns {string} string of [HH:mm:ss] date format
|
|
10
10
|
*/
|
|
11
11
|
export function dateToHms(date, settings) {
|
|
12
12
|
if (!isValidPotentialDate(date))
|
|
@@ -23,8 +23,8 @@ export function dateToHms(date, settings) {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Gets the settings for this function.
|
|
26
|
-
* @param settings the settings of the dateToHms function
|
|
27
|
-
* @returns a new object for the settings
|
|
26
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
27
|
+
* @returns {IDFDateToHmsSettings} a new object for the settings
|
|
28
28
|
*/
|
|
29
29
|
function getDefaultSettings(settings) {
|
|
30
30
|
var _a, _b, _c;
|
|
@@ -32,27 +32,27 @@ function getDefaultSettings(settings) {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Gets the Hours
|
|
35
|
-
* @param date the date object
|
|
36
|
-
* @param settings the settings of the dateToHms function
|
|
37
|
-
* @returns the hour string
|
|
35
|
+
* @param {Date} date the date object
|
|
36
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
37
|
+
* @returns {string} the hour string
|
|
38
38
|
*/
|
|
39
39
|
function getHours(date, settings) {
|
|
40
40
|
return padLeadingZeros(settings.omitHour ? "0" : date.getHours(), 2).slice(-2);
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Gets the Minutes
|
|
44
|
-
* @param date the date object
|
|
45
|
-
* @param settings the settings of the dateToHms function
|
|
46
|
-
* @returns the minute string
|
|
44
|
+
* @param {Date} date the date object
|
|
45
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
46
|
+
* @returns {string} the minute string
|
|
47
47
|
*/
|
|
48
48
|
function getMinutes(date, settings) {
|
|
49
49
|
return padLeadingZeros(settings.omitMinute ? "0" : date.getMinutes(), 2).slice(-2);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Gets the Seconds
|
|
53
|
-
* @param date the date object
|
|
54
|
-
* @param settings the settings of the dateToHms function
|
|
55
|
-
* @returns the seconds string
|
|
53
|
+
* @param {Date} date the date object
|
|
54
|
+
* @param {IDFDateToHmsSettings} settings the settings of the dateToHms function
|
|
55
|
+
* @returns {string} the seconds string
|
|
56
56
|
*/
|
|
57
57
|
function getSeconds(date, settings) {
|
|
58
58
|
return 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;
|
|
@@ -6,8 +6,9 @@ import { isValidPotentialDate } from "../helpers/isValidPotentialDate";
|
|
|
6
6
|
import { dateToHms } from "./dateToHms";
|
|
7
7
|
/**
|
|
8
8
|
* Transform a Date to [mm/dd/yyyy] date format.
|
|
9
|
-
* @param date String, object or millisencond number of the date
|
|
10
|
-
* @
|
|
9
|
+
* @param {IDate} date String, object or millisencond number of the date
|
|
10
|
+
* @param {IDateSettings} settings the configuration of dates
|
|
11
|
+
* @returns {string} string of [mm/dd/yyyy] date format
|
|
11
12
|
*/
|
|
12
13
|
export function dateToMdyDate(date, settings) {
|
|
13
14
|
if (!isValidPotentialDate(date))
|