Skip to content

Commit

Permalink
修复demo中多)的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Feb 8, 2021
1 parent d3b4a13 commit da9e210
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ carbon.Parse("2020-08-05 13:14:15").DiffInSecondsWithAbs(carbon.Parse("2020-08-0

// Difference for humans in English
carbon.Now().DiffForHumans()) // just now
carbon.Now().SubYears(1).DiffForHumans()) // 1 years ago
carbon.Now().SubYears(2).DiffForHumans()) // 2 year ago
carbon.Now().AddYears(1).DiffForHumans()) // in 1 year
carbon.Now().AddYears(2).DiffForHumans()) // in 2 years
carbon.Now().SubYears(1).DiffForHumans() // 1 years ago
carbon.Now().SubYears(2).DiffForHumans() // 2 year ago
carbon.Now().AddYears(1).DiffForHumans() // in 1 year
carbon.Now().AddYears(2).DiffForHumans() // in 2 years
// Difference for humans in Chinese
carbon.Now().SetLocale("zh-CN").DiffForHumans()) // 刚刚
carbon.Now().SubMonths(1).SetLocale("zh-CN").DiffForHumans()) // 1 月前
carbon.Now().AddMonths(2).SetLocale("zh-CN").DiffForHumans()) // 2 月后
carbon.Now().SetLocale("zh-CN").DiffForHumans() // 刚刚
carbon.Now().SubMonths(1).SetLocale("zh-CN").DiffForHumans() // 1 月前
carbon.Now().AddMonths(2).SetLocale("zh-CN").DiffForHumans() // 2 月后
```

##### Time compare
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ carbon.Parse("2020-08-05 13:14:15").DiffInSecondsWithAbs(carbon.Parse("2020-08-0

// 对人类友好的可读格式时间差(默认英文)
carbon.Now().DiffForHumans()) // just now
carbon.Now().SubYears(1).DiffForHumans()) // 1 years ago
carbon.Now().SubYears(2).DiffForHumans()) // 2 year ago
carbon.Now().AddYears(1).DiffForHumans()) // in 1 year
carbon.Now().AddYears(2).DiffForHumans()) // in 2 years
carbon.Now().SubYears(1).DiffForHumans() // 1 years ago
carbon.Now().SubYears(2).DiffForHumans() // 2 year ago
carbon.Now().AddYears(1).DiffForHumans() // in 1 year
carbon.Now().AddYears(2).DiffForHumans() // in 2 years
// 对人类友好的可读格式时间差(指定语言)
carbon.Now().SetLocale("zh-CN").DiffForHumans()) // 刚刚
carbon.Now().SubMonths(1).SetLocale("zh-CN").DiffForHumans()) // 1 月前
carbon.Now().AddMonths(2).SetLocale("zh-CN").DiffForHumans()) // 2 月后
carbon.Now().SetLocale("zh-CN").DiffForHumans() // 刚刚
carbon.Now().SubMonths(1).SetLocale("zh-CN").DiffForHumans() // 1 月前
carbon.Now().AddMonths(2).SetLocale("zh-CN").DiffForHumans() // 2 月后

```

Expand Down

0 comments on commit da9e210

Please sign in to comment.