Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
a941f10af3 | |||
6e7f8f3dda | |||
bfa00feadd | |||
55c2d95b7d |
10
changelog.md
10
changelog.md
@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2024-12-13 - 4.1.1 - fix(smarttime.units)
|
||||||
|
Fix issue in getMilliSecondsAsHumanReadableAgoTime
|
||||||
|
|
||||||
|
- Corrected the parameter type passed to date-fns.formatDistanceToNow within getMilliSecondsAsHumanReadableAgoTime function.
|
||||||
|
|
||||||
|
## 2024-12-13 - 4.1.0 - feat(smarttime.units)
|
||||||
|
Add function to get human-readable time ago string from milliseconds.
|
||||||
|
|
||||||
|
- Introduced `getMilliSecondsAsHumanReadableAgoTime` to convert a timestamp to a human-readable text indicating time ago.
|
||||||
|
|
||||||
## 2024-12-13 - 4.0.9 - fix(dependencies)
|
## 2024-12-13 - 4.0.9 - fix(dependencies)
|
||||||
Updated dependencies in package.json and resolved cron function issues.
|
Updated dependencies in package.json and resolved cron function issues.
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smarttime",
|
"name": "@push.rocks/smarttime",
|
||||||
"private": false,
|
"private": false,
|
||||||
"version": "4.0.9",
|
"version": "4.1.1",
|
||||||
"description": "Provides utilities for advanced time handling including cron jobs, timestamps, intervals, and more.",
|
"description": "Provides utilities for advanced time handling including cron jobs, timestamps, intervals, and more.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smarttime',
|
name: '@push.rocks/smarttime',
|
||||||
version: '4.0.9',
|
version: '4.1.1',
|
||||||
description: 'Provides utilities for advanced time handling including cron jobs, timestamps, intervals, and more.'
|
description: 'Provides utilities for advanced time handling including cron jobs, timestamps, intervals, and more.'
|
||||||
}
|
}
|
||||||
|
@ -67,3 +67,7 @@ export let getMilliSecondsFromUnits = (combinationArg: IUnitCombinationArg) => {
|
|||||||
export const getMilliSecondsAsHumanReadableString = (milliSecondsArg: number): string => {
|
export const getMilliSecondsAsHumanReadableString = (milliSecondsArg: number): string => {
|
||||||
return plugins.prettyMs(milliSecondsArg);
|
return plugins.prettyMs(milliSecondsArg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getMilliSecondsAsHumanReadableAgoTime = (timeStampArg: number): string => {
|
||||||
|
return plugins.dateFns.formatDistanceToNow(new Date(timeStampArg));
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user