diff --git a/changelog.md b/changelog.md index b9d60e2..0b55d9a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # 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. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 7527b83..807b9ce 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smarttime', - version: '4.1.0', + version: '4.1.1', description: 'Provides utilities for advanced time handling including cron jobs, timestamps, intervals, and more.' } diff --git a/ts/smarttime.units.ts b/ts/smarttime.units.ts index ff9af3b..6120946 100644 --- a/ts/smarttime.units.ts +++ b/ts/smarttime.units.ts @@ -69,5 +69,5 @@ export const getMilliSecondsAsHumanReadableString = (milliSecondsArg: number): s }; export const getMilliSecondsAsHumanReadableAgoTime = (timeStampArg: number): string => { - return plugins.dateFns.formatDistanceToNow(timeStampArg); + return plugins.dateFns.formatDistanceToNow(new Date(timeStampArg)); }