Skip to content

Commit

Permalink
Fix bug in hideSeconds mode
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed May 23, 2023
1 parent b66979b commit 55fef39
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 1.0.1 (2023-05-23)

- Fix bug in `hideSeconds` mode

## 1.0.0 (2023-05-18)

- Initial release
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# react-timeago-i18n

[![build](https://github.com/k-yle/react-timeago-i18n/actions/workflows/ci.yml/badge.svg)](https://github.com/k-yle/react-timeago-i18n/actions/workflows/ci.yml)
[![npm version](https://badge.fury.io/js/react-timeago-i18n.svg)](https://badge.fury.io/js/react-timeago-i18n)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-timeago-i18n)

📅🌏 A tiny relative time component for react, which uses the browser's native [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat) API.
This means that all languages are supported without bundling translations.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-timeago-i18n",
"version": "1.0.0",
"version": "1.0.1",
"author": "Kyle Hensel",
"license": "MIT",
"description": "📅🌏 A relative time component for react using the browser's native internationalization API",
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const TimeAgo = memo<TimeAgoProps>(
const [value, newUnit] = timeSince(dateObj);
setText(
newUnit === "seconds" && hideSeconds
? formatter.format(1, "minute")
? formatter.format(-1, "minute")
: formatter.format(-value, newUnit)
);
setUnit(newUnit);
Expand Down

0 comments on commit 55fef39

Please sign in to comment.