forked from FAForever/downlords-faf-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proper time filtering to rating graph and display year
Fixes FAForever#935 Fixes FAForever#1220 Co-authored-by: axel1200 <alexander.von.trostorff@gmail.com>
- Loading branch information
1 parent
838d26b
commit 5f1856f
Showing
6 changed files
with
137 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.faforever.client.chat; | ||
|
||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public enum TimePeriod { | ||
ALL_TIME("userInfo.ratingHistory.allTime", LocalDateTime.MIN), | ||
LAST_YEAR("userInfo.ratingHistory.lastYear", LocalDateTime.now().minusYears(1)), | ||
LAST_MONTH("userInfo.ratingHistory.lastMonth", LocalDateTime.now().minusMonths(1)); | ||
|
||
@Getter | ||
private final String i18nKey; | ||
@Getter | ||
private final LocalDateTime date; | ||
|
||
TimePeriod(String i18nKey, LocalDateTime date) { | ||
this.i18nKey = i18nKey; | ||
this.date = date; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
package com.faforever.client.fa; | ||
|
||
import com.faforever.client.game.KnownFeaturedMod; | ||
import lombok.Getter; | ||
|
||
public enum RatingMode { | ||
GLOBAL, | ||
LADDER_1V1, | ||
NONE | ||
GLOBAL("userInfo.ratingHistory.global", KnownFeaturedMod.FAF), | ||
LADDER_1V1("userInfo.ratingHistory.1v1", KnownFeaturedMod.LADDER_1V1), | ||
NONE("", null); | ||
|
||
@Getter | ||
private final String i18nKey; | ||
@Getter | ||
private final KnownFeaturedMod featuredMod; | ||
|
||
RatingMode(String i18nKey, KnownFeaturedMod featuredMod) { | ||
this.i18nKey = i18nKey; | ||
this.featuredMod = featuredMod; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters