Skip to content

Commit

Permalink
Merge pull request #39 from SerhiiCho/v2.2.1
Browse files Browse the repository at this point in the history
V2.2.1
  • Loading branch information
SerhiiCho authored Mar 28, 2024
2 parents c0f764c + 1cf3216 commit 20b6efe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
19 changes: 12 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# 🗒 Release Notes

## v2.2.0 (2024-03-08)
## v2.2.1 (2024-03-28)

- Add the German 🇩🇪 language support
- Updated `README.md` file by adding more information about supported languages
- Formatted `CHANGELOG.md` file
- Added more tests

## v2.2.0 (2024-03-08)

- Added the German 🇩🇪 language support
- Formatted `CHANGELOG.md` file

## v2.1.11 (2023-12-26)

- Update Go version in `go.mod` to `1.13`
- Change package namespace to `github.com/SerhiiCho/timeago/v2` to match Go versioning rules
- Updated Go version in `go.mod` to `1.13`
- Changed package namespace to `github.com/SerhiiCho/timeago/v2` to match Go versioning rules

## v2.1.10 (2023-12-26)

- Update Go version in `go.mod` from `1.13` to `1.21.0`
- Updated Go version in `go.mod` from `1.13` to `1.21.0`

## v2.1.9 (2023-12-26)

- Update `CHANGELOG.md` file
- Updated `CHANGELOG.md` file

## v2.1.8 (2023-12-03)

Expand Down Expand Up @@ -83,7 +88,7 @@

## v2.0.3 (2022-01-22)

- Added support for Dutch language
- Added support for Dutch 🇳🇱 language

## v2.0.2 (2022-01-21)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SerhiiCho/timeago/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/SerhiiCho/timeago/?branch=main)
[![GitHub](https://img.shields.io/github/license/SerhiiCho/timeago)](https://github.com/SerhiiCho/timeago/blob/main/LICENSE.md)

Fast and lightweight date time package that converts given date into "n time ago" format. The package has many cool features and several supported languages.
Timeago is a fast and lightweight date time package that converts given date into human readable "n time ago" format in different languages, such as 🇷🇺 🇬🇧 🇺🇦 🇩🇪. For more information you can read the [documentation](https://serhiicho.github.io/timeago-docs/).

### Follow the [Official documentation](https://serhiicho.github.io/timeago-docs/) for all the details

Expand Down
24 changes: 11 additions & 13 deletions timeago_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ func TestGetWords(t *testing.T) {

for _, tc := range cases {
t.Run(tc.result, func(test *testing.T) {
SetConfig(Config{
Language: tc.lang,
})
SetConfig(Config{Language: tc.lang})

if res := getWords(tc.timeKind, tc.num); res != tc.result {
test.Errorf("Result must be `%s` but got `%s` instead", tc.result, res)
Expand All @@ -48,13 +46,17 @@ func TestParseFunctionCanExceptTimestamp(t *testing.T) {
{getTimestampOfPastDate(time.Minute * 5), "5 minutes ago"},
{getTimestampOfPastDate(time.Hour), "1 hour ago"},
{getTimestampOfPastDate(time.Hour * 3), "3 hours ago"},
{getTimestampOfPastDate(time.Hour * 5), "5 hours ago"},
{getTimestampOfPastDate(time.Hour * 24), "1 day ago"},
{getTimestampOfPastDate(time.Hour * 48), "2 days ago"},
{getTimestampOfPastDate(time.Hour * 24 * 2), "2 days ago"},
{getTimestampOfPastDate(time.Hour * 24 * 3), "3 days ago"},
{getTimestampOfPastDate(time.Hour * 24 * 4), "4 days ago"},
{getTimestampOfPastDate(time.Hour * 24 * 5), "5 days ago"},
{getTimestampOfPastDate(time.Hour * 24 * 6), "6 days ago"},
{getTimestampOfPastDate(time.Hour * 24 * 7), "1 week ago"},
}

SetConfig(Config{
Language: "en",
})
SetConfig(Config{Language: "en"})

for _, tc := range cases {
t.Run(tc.result, func(test *testing.T) {
Expand Down Expand Up @@ -83,9 +85,7 @@ func TestParseFunctionCanExceptTimePackage(t *testing.T) {
{time.Now().Add(-time.Hour * 11), "11 hours ago"},
}

SetConfig(Config{
Language: "en",
})
SetConfig(Config{Language: "en"})

for _, tc := range cases {
t.Run("Test for date "+tc.time.String(), func(test *testing.T) {
Expand All @@ -109,9 +109,7 @@ func TestParseFuncWillCalculateIntervalToFutureDate(t *testing.T) {
{time.Now().Add(time.Hour * 48), "2 days"},
}

SetConfig(Config{
Language: "en",
})
SetConfig(Config{Language: "en"})

for _, tc := range testCases {
t.Run("Test for date: "+tc.time.String(), func(test *testing.T) {
Expand Down

0 comments on commit 20b6efe

Please sign in to comment.