summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/utils/TimeUtils.java
Commit message (Collapse)AuthorAgeFilesLines
* TimeUtils: Change daysAgo to calculate difference in calendar daysFlorian Zschocke2021-10-241-1/+52
| | | | | | | | | | | | | The `daysAgo` method seemed to want to normalize on a calendar day? I can't really tell what it was trying to do, but the problem is that it does not take into account any time shift due to time zones so it never really worked outside of GMT. So instead a new `calendarDaysAgo` method is added (because I am unsure on what the `daysAgo` method is trying to do. It can probably be removed). The new method cleanly calculates difference in calendar days because it normalizes the two given time stamps on the same time zone. The `timeAgo` method now used the new method. This fixes #1248.
* TimeUtils: Move unit test to same package as TimeUtils isFlorian Zschocke2021-10-231-5/+5
| | | | | | | | | | For some reason the `TimeUtilsTest` class is, like almost all tests, in the `com.gitblit.tests` package. But this way all methods in classes which we might predominately need for tests have to be public. So move the unit test class `TimeUtilsTest` to the same package as the class it is testing, i.e. `com.gitblit.utils.TimeUtils`. This way we ca set the new added methods which get the current time passed in to be at least not public.
* TimeUtils: Increase testability and add testsFlorian Zschocke2021-10-231-8/+32
| | | | | | | | | Add tests for `timeAgo` to analyse issue #1248. The tests are dependent on when they run as they time functions use the current date and time. To make them testable in a reproducible way, we need the ability to pass in what we think is "now". So add overloaded methods that take a `now` parameter so that we can pass in the current time.
* Expose setting to control Lucene repository indexing frequencyJames Moger2014-09-081-11/+12
|
* Trim trailing whitespace and organize importsJames Moger2013-09-301-20/+20
| | | | Change-Id: I9f91138b20219be6e3c4b28251487df262bff6cc
* Refinements to push log display and daily digestsJames Moger2013-05-311-6/+18
| | | | | | * Properly support timezone-based date groupings * Polish css for the major browsers on Win & Linux * Use Gitblit constants for refs instead of JGit constants
* Reorganized to Apache Standard Directory Layout & integrated MoxieJames Moger2013-03-271-0/+341
This is a massive commit which reorganizes the entire project structure (although it is still monolithic), removes the Build classes, and switches to Moxie, a smarter Ant build tookit based on the original Gitblit Build classes. The Ant build script will likely require additional fine-tuning, but this is big step forward.