time-date-tools
Advanced tools
Comparing version 0.0.1 to 0.0.11
{ | ||
"name": "time-date-tools", | ||
"version": "0.0.1", | ||
"version": "0.0.11", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./out/index.js", |
@@ -35,2 +35,6 @@ | ||
<br> | ||
You can enclose certain parts of your format with brackets `[]`, the values contained in these brackets will be displayed even if they are null. | ||
<u>Some usage examples:</u> | ||
@@ -169,1 +173,61 @@ | ||
``` | ||
<br> | ||
# Datas | ||
Availables tokens for the date format. | ||
|Token|Description|Output| | ||
|:-:|:-:|:-:| | ||
|Y|four-digit year|2022| | ||
|y|two-digit year|22| | ||
|MMOO|month name|January| | ||
|MO|two-digit month|01| | ||
|mo|month|1| | ||
|DD|day name|Monday| | ||
|D|two-digit day|01| | ||
|D-|two-digit day with indice|01st| | ||
|d|day|1| | ||
|d-|one-digit day with indice|1st| | ||
|H|two-digit hour|09, 14| | ||
|h|hour|9, 14| | ||
|M|two-digit minute|05, 34| | ||
|m|minute|5, 34| | ||
|S|two-digit second|02, 58| | ||
|s|second|2, 58| | ||
|MS|three-digit millisecond|009, 158| | ||
|ms|millisecond|9, 158| | ||
Availables tokens for the time format. | ||
|Token|Description|Output| | ||
|:-:|:-:|:-:| | ||
|YY|year unity (long)|year, years| | ||
|yy|year unity (short)|y| | ||
|Y|four-digit year|2022| | ||
|y|two-digit year|22| | ||
|MMOO|month unity (long)|month, months| | ||
|mmoo|month unity (short)|m| | ||
|MO|two-digit month|01| | ||
|mo|month|1| | ||
|DD|day unity (long)|day, days| | ||
|dd|day unity (short)|d| | ||
|D|two-digit day|01| | ||
|d|day|1| | ||
|HH|hour unity (long)|hour, hours| | ||
|hh|hour unity (short)|h| | ||
|H|two-digit hour|09, 14| | ||
|h|hour|9, 14| | ||
|MM|minute unity (long)|minute, minutes| | ||
|mm|minute unity (short)|m| | ||
|M|two-digit minute|05, 34| | ||
|m|minute|5, 34| | ||
|SS|second unity (long)|seconds, second| | ||
|ss|second unity (short)|s| | ||
|S|two-digit second|02, 58| | ||
|s|second|2, 58| | ||
|MMSS|millisecond unity (long)|millisecond, milliseconds| | ||
|mmss|millisecond unity (short)|ms| | ||
|MS|three-digit millisecond|009, 158| | ||
|ms|millisecond|9, 158| |
@@ -1,9 +0,8 @@ | ||
export interface formatTimeOptions { | ||
interface formatTimeOptions { | ||
lang?: 'fr' | 'en'; | ||
format?: string | undefined; | ||
valueNull?: boolean; | ||
} | ||
/** | ||
* | ||
* | ||
* @param time The time in milliseconds to convert into any format | ||
@@ -14,11 +13,29 @@ * @param options The options of the format returned | ||
export interface parseTimeOptions { | ||
msOff?: boolean; | ||
interface parseTimeOptions { | ||
msOff?: boolean; | ||
} | ||
/** | ||
* | ||
* | ||
* @param time The time in string to convert in milliseconds or seconds | ||
* @param options The options of the time returned | ||
*/ | ||
export function parseTime(time: string, options?: parseTimeOptions): number; | ||
export function parseTime(time: string, options?: parseTimeOptions): number; | ||
interface formatDateOptions { | ||
lang?: 'fr' | 'en'; | ||
format?: string | undefined; | ||
} | ||
/** | ||
* | ||
* @param {*} dateInMilliseconds The date in milliseconds to convert into any format | ||
* @param {*} options The options of the format returned | ||
*/ | ||
export function formatTime(dateInMilliseconds: number, options: formatDateOptions): string; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
27176
14
430
232
2
1