fenextjs-functions
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -98,1 +98,24 @@ import { TypeDate } from "fenextjs-interface/cjs/Date"; | ||
export declare const getTimeToText: (date: Date, options?: getTimeToTextProps) => string; | ||
export interface parseDateTimeFormatOptions { | ||
localeMatcher?: "best fit" | "lookup" | undefined; | ||
weekday?: "long" | "short" | "narrow" | undefined; | ||
era?: "long" | "short" | "narrow" | undefined; | ||
year?: "numeric" | "2-digit" | undefined; | ||
month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined; | ||
day?: "numeric" | "2-digit" | undefined; | ||
hour?: "numeric" | "2-digit" | undefined; | ||
minute?: "numeric" | "2-digit" | undefined; | ||
second?: "numeric" | "2-digit" | undefined; | ||
timeZoneName?: "short" | "long" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric" | undefined; | ||
formatMatcher?: "best fit" | "basic" | undefined; | ||
hour12?: boolean | undefined; | ||
timeZone?: string | undefined; | ||
locales?: string | string[] | undefined; | ||
} | ||
/** | ||
* Gets the time value in custom formated | ||
* @param {Date} date - The date from which to get the time value. | ||
* @param {parseDateTimeFormatOptions} options - The Options for formated | ||
* @returns {string} - The time value in "hh:mm" format. | ||
*/ | ||
export declare const parseDateTimeFormat: (date: Date, options: parseDateTimeFormatOptions) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTimeToText = exports.getTimeValue = exports.getISOWeek = exports.getWeekValue = exports.getMonthValue = exports.parseDateToText = exports.parseTextToDate = exports.parseDateYYYYMMDD = void 0; | ||
exports.parseDateTimeFormat = exports.getTimeToText = exports.getTimeValue = exports.getISOWeek = exports.getWeekValue = exports.getMonthValue = exports.parseDateToText = exports.parseTextToDate = exports.parseDateYYYYMMDD = void 0; | ||
/** | ||
@@ -163,2 +163,13 @@ * Converts a Date object into a string in the "YYYY-MM-DD" format. | ||
exports.getTimeToText = getTimeToText; | ||
/** | ||
* Gets the time value in custom formated | ||
* @param {Date} date - The date from which to get the time value. | ||
* @param {parseDateTimeFormatOptions} options - The Options for formated | ||
* @returns {string} - The time value in "hh:mm" format. | ||
*/ | ||
const parseDateTimeFormat = (date, options) => { | ||
const formatter = new Intl.DateTimeFormat(options?.locales, options); | ||
return formatter.format(date); | ||
}; | ||
exports.parseDateTimeFormat = parseDateTimeFormat; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "fenextjs-functions", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
Sorry, the diff of this file is not supported yet
44791
703