aboutsummaryrefslogtreecommitdiffstats
path: root/modules/timeutil/timestamp.go
Commit message (Collapse)AuthorAgeFilesLines
* Check for zero time instant in TimeStamp.IsZero() (#22171) (#22172)Gusted2022-12-201-3/+8
| | | | | | | | | | | - Backport of #22171 - Currently, the 'IsZero' function for 'TimeStamp' just checks if the unix time is zero, which is not the behavior of 'Time.IsZero()', but Gitea is using this method in accordance with the behavior of 'Time.IsZero()'. - Adds a new condition to check for the zero time instant. - Fixes a bug where non-expiring GPG keys where shown as they expired on Jan 01, 0001. - Related https://codeberg.org/Codeberg/Community/issues/791
* Fix `Timestamp.IsZero` (#21593) (#21603)KN4CK3R2022-10-271-1/+1
| | | | | Backport of #21593 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Replace `ServeStream` with `ServeContent` (#20903)KN4CK3R2022-08-251-0/+5
| | | | | | | | | | | * Replace ServeStream with ServeContent. * Update modules/timeutil/timestamp.go Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add more linters to improve code readability (#19989)Wim2022-06-201-1/+1
| | | | | | | | | | Add nakedret, unconvert, wastedassign, stylecheck and nolintlint linters to improve code readability - nakedret - https://github.com/alexkohler/nakedret - nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length. - unconvert - https://github.com/mdempsky/unconvert - Remove unnecessary type conversions - wastedassign - https://github.com/sanposhiho/wastedassign - wastedassign finds wasted assignment statements. - notlintlint - Reports ill-formed or insufficient nolint directives - stylecheck - https://staticcheck.io/docs/checks/#ST - keep style consistent - excluded: [ST1003 - Poorly chosen identifier](https://staticcheck.io/docs/checks/#ST1003) and [ST1005 - Incorrectly formatted error string](https://staticcheck.io/docs/checks/#ST1005)
* Allow mocking timeutil (#17354)John Olheiser2021-10-181-0/+16
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix timezone on issue deadline (#11697)Cirno the Strongest2020-06-051-0/+5
| | | | | | | * Fix timezone on issue deadline * FormatDate Co-authored-by: zeripath <art27@cantab.net>
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-0/+81
* display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger