mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Fix front percent returning negative percentages and ranges
This commit is contained in:
parent
548fe09fd4
commit
f53344cd89
4 changed files with 12 additions and 11 deletions
|
|
@ -146,12 +146,12 @@ namespace PluralKit.Bot {
|
|||
.Build();
|
||||
}
|
||||
|
||||
public async Task<Embed> CreateFrontPercentEmbed(SwitchStore.PerMemberSwitchDuration frontpercent, ZonedDateTime startingFrom)
|
||||
public async Task<Embed> CreateFrontPercentEmbed(SwitchStore.PerMemberSwitchDuration frontpercent, DateTimeZone tz)
|
||||
{
|
||||
var actualPeriod = frontpercent.RangeEnd - frontpercent.RangeStart;
|
||||
var eb = new EmbedBuilder()
|
||||
.WithColor(Color.Blue)
|
||||
.WithFooter($"Since {Formats.ZonedDateTimeFormat.Format(startingFrom)} ({Formats.DurationFormat.Format(actualPeriod)} ago)");
|
||||
.WithFooter($"Since {Formats.ZonedDateTimeFormat.Format(frontpercent.RangeStart.InZone(tz))} ({Formats.DurationFormat.Format(actualPeriod)} ago)");
|
||||
|
||||
var maxEntriesToDisplay = 24; // max 25 fields allowed in embed - reserve 1 for "others"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue