@formkit/tempo
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -116,2 +116,28 @@ /** | ||
} | ||
interface FormatOptions { | ||
/** | ||
* A date object or ISO 8601 string. | ||
*/ | ||
date: DateInput; | ||
/** | ||
* A format string or object. | ||
*/ | ||
format: Format; | ||
/** | ||
* A locale or en by default. | ||
*/ | ||
locale?: "en"; | ||
/** | ||
* Whether or not to escape literals. | ||
*/ | ||
genitive?: false; | ||
/** | ||
* A function to filter parts. | ||
*/ | ||
tz?: string; | ||
/** | ||
* A function to filter parts. | ||
*/ | ||
partFilter?: (part: Part) => boolean; | ||
} | ||
@@ -204,29 +230,31 @@ /** | ||
* Produce a formatted string. Available strings: | ||
* token | description | ||
* ------|------------ | ||
* YY | 2 digit year | ||
* YYYY | 4 digit year | ||
* M | The month 1-12 | ||
* MM | The month 01-12 | ||
* MMM | Short name Jan-Dec | ||
* MMMM | Full name January | December | ||
* D | The day of the month 1-31 | ||
* DD | The day of the month 01-31 | ||
* d | Single digit day "T" | ||
* ddd | Short day name Thu | ||
* dddd | Full day name Wednesday | ||
* H | Minimum hour digits, 24 hour, 0-23 | ||
* HH | 2 hour digits, 24 hour, 00-23 | ||
* h | Minimum hour digits, 12 hour clock, 1-12 | ||
* hh | 2 hour digits, 12 hour clock, 01-12 | ||
* m | The minute 0-59 | ||
* mm | The minute 00-59 | ||
* s | The second 0-59 | ||
* ss | The second 00-59 | ||
* a | am/pm | ||
* A | AM/PM | ||
* Z | +0800, +0530, -1345 | ||
* | ||
* YY - 2 digit year | ||
* YYYY - 4 digit year | ||
* M - The month 1-12 | ||
* MM - The month 01-12 | ||
* MMM - Short name Jan-Dec | ||
* MMMM - Full name January - December | ||
* D - The day of the month 1-31 | ||
* DD - The day of the month 01-31 | ||
* d - Single digit day "T" | ||
* ddd - Short day name Thu | ||
* dddd - Full day name Wednesday | ||
* H - Minimum hour digits, 24 hour, 0-23 | ||
* HH - 2 hour digits, 24 hour, 00-23 | ||
* h - Minimum hour digits, 12 hour clock, 1-12 | ||
* hh - 2 hour digits, 12 hour clock, 01-12 | ||
* m - The minute 0-59 | ||
* mm - The minute 00-59 | ||
* s - The second 0-59 | ||
* ss - The second 00-59 | ||
* a - am/pm | ||
* A - AM/PM | ||
* Z - +0800, +0530, -1345 | ||
* | ||
* @param inputDate - A date object or ISO 8601 string | ||
* @param format - A format | ||
*/ | ||
declare function format(options: FormatOptions): string; | ||
declare function format(inputDate: DateInput, format?: Format, locale?: string, genitive?: boolean, partFilter?: (part: Part) => boolean): string; | ||
@@ -292,4 +320,4 @@ | ||
* @param dateInput - The date on which to determine the offset. | ||
* @param tzA - The second timezone to compare determine the offset between. | ||
* @param tzB - The first timezone to compare determine the offset between. | ||
* @param tzA - (default: UTC) The second timezone to compare determine the offset between. | ||
* @param tzB - (default: device) The first timezone to compare determine the offset between. | ||
*/ | ||
@@ -355,2 +383,2 @@ declare function offset(utcTime: DateInput, tzA?: string, tzB?: string): string; | ||
export { type DateInput, type FilledPart, type Format, type FormatPattern, type FormatStyle, type FormatStyleObj, type FormatToken, type NamedFormatOption, type NamedFormats, type ParseOptions, type Part, addDay, addHour, addMinute, addMonth, addSecond, addYear, ap, applyOffset, date, dayEnd, dayOfYear, dayStart, format, formatStr, fourDigitYear, iso8601, monthDays, monthEnd, monthStart, nearestDay, offset, parse, parts, range, removeOffset, sameDay, weekEnd, weekStart, yearDays }; | ||
export { type DateInput, type FilledPart, type Format, type FormatOptions, type FormatPattern, type FormatStyle, type FormatStyleObj, type FormatToken, type NamedFormatOption, type NamedFormats, type ParseOptions, type Part, addDay, addHour, addMinute, addMonth, addSecond, addYear, ap, applyOffset, date, dayEnd, dayOfYear, dayStart, format, formatStr, fourDigitYear, iso8601, monthDays, monthEnd, monthStart, nearestDay, offset, parse, parts, range, removeOffset, sameDay, weekEnd, weekStart, yearDays }; |
{ | ||
"name": "@formkit/tempo", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "The easiest way to work with dates in JavaScript and TypeScript.", | ||
@@ -21,3 +21,4 @@ "type": "module", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"docs/public" | ||
], | ||
@@ -24,0 +25,0 @@ "keywords": [ |
<img src="docs/public/tempo.png" alt="TEMPO" width="500" height="195"> | ||
[![Vitest](https://github.com/formkit/tempo/actions/workflows/tests.yml/badge.svg)](https://github.com/formkit/tempo/actions/workflows/tests.yml) | ||
![GitHub Sponsors](https://img.shields.io/github/sponsors/formkit) | ||
![NPM Version](https://img.shields.io/npm/v/%40formkit%2Ftempo) | ||
@@ -11,3 +13,5 @@ # Tempo — The easiest way to work with dates in JavaScript (and TypeScript) | ||
[Read the docs](https://tempo.formkit.com) | ||
<a href="https://tempo.formkit.com"> | ||
<img src="docs/public/read-the-docs.png" alt="Read the docs" width="200" height="43"> | ||
</a> | ||
@@ -14,0 +18,0 @@ --- |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
353056
14
2272
20