Skip to content

Commit

Permalink
fix(utils): relative time display (#880)
Browse files Browse the repository at this point in the history
Co-authored-by: Raphaël Odini <[email protected]>
  • Loading branch information
TTalex and raphodn authored Sep 30, 2024
1 parent 020fc79 commit c787dea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function offDateTime(dateTimeString) {
* changes: add short (replace 'days' with 'd', remove 'Yesterday') & shortest (remove 'ago'), extend days & weeks
*/
function prettyRelativeDateTime(dateTimeString, size=null) {
var date = new Date((dateTimeString || "").replace(/-/g, "/").replace(/[TZ]/g, " ")),
var date = new Date(dateTimeString || ''),
diff = (((new Date()).getTime() - date.getTime()) / 1000),
day_diff = Math.floor(diff / 86400);

Expand Down

0 comments on commit c787dea

Please sign in to comment.