idea-toolbox
Advanced tools
Comparing version 6.5.14 to 6.5.15
@@ -19,1 +19,7 @@ /** | ||
export declare type epochISOString = string; | ||
/** | ||
* Alias to avoid explaining the type for each variable. | ||
* | ||
* It's a date time in epoch format (reference date) stored in ISO string: YYYY-MM-DD. | ||
*/ | ||
export declare type epochISODateString = string; |
import { markdown } from './markdown'; | ||
import { epochISODateString } from './epoch'; | ||
/** | ||
@@ -13,2 +14,6 @@ * Utilities (static) functions, to support IDEA's projects. | ||
/** | ||
* Parse a date in the format YYYY-MM-DD. | ||
*/ | ||
export declare function toISODate(date: Date | string | number): epochISODateString; | ||
/** | ||
* Convert a date to the specified locale format. | ||
@@ -15,0 +20,0 @@ * @param date the date to convert |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mdToHtml = exports.loopNumericEnumValues = exports.loopNumericEnumKeys = exports.getStringEnumKeyByValue = exports.loopStringEnumValues = exports.loopStringEnumKeys = exports.logger = exports.isEmpty = exports.joinArraysOnKeys = exports.cleanStr = exports.dateToLocale = exports.ISODateToItalianFormat = void 0; | ||
exports.mdToHtml = exports.loopNumericEnumValues = exports.loopNumericEnumKeys = exports.getStringEnumKeyByValue = exports.loopStringEnumValues = exports.loopStringEnumKeys = exports.logger = exports.isEmpty = exports.joinArraysOnKeys = exports.cleanStr = exports.dateToLocale = exports.toISODate = exports.ISODateToItalianFormat = void 0; | ||
const isEmail_1 = __importDefault(require("validator/lib/isEmail")); | ||
@@ -28,2 +28,11 @@ const isMobilePhone_1 = __importDefault(require("validator/lib/isMobilePhone")); | ||
/** | ||
* Parse a date in the format YYYY-MM-DD. | ||
*/ | ||
function toISODate(date) { | ||
if (!date) | ||
return null; | ||
return new Date(date).toISOString().slice(0, 10); | ||
} | ||
exports.toISODate = toISODate; | ||
/** | ||
* Convert a date to the specified locale format. | ||
@@ -30,0 +39,0 @@ * @param date the date to convert |
{ | ||
"name": "idea-toolbox", | ||
"version": "6.5.14", | ||
"version": "6.5.15", | ||
"description": "IDEA's utility functions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
241391
7097