mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Allow frontpercent to accept time patterns in system timezone (#135)
The frontpercent command already accepted time patterns (e.g. 9pm), but these were always being interpreted as UTC regardless of the system's configured zone. Furthermore, the time wasn't being nudged to the previous day, so if you tried to do pk;s fp 6pm at 5pm UTC, it would complain about the date being in the future instead of just showing you since 6pm yesterday. The system zone is now respected and nudging enabled in the same manner as pk;sw move.
This commit is contained in:
parent
545e8df6a7
commit
eb5fe7d6a4
1 changed files with 1 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ namespace PluralKit.Bot.Commands
|
|||
|
||||
var now = SystemClock.Instance.GetCurrentInstant();
|
||||
|
||||
var rangeStart = PluralKit.Utils.ParseDateTime(durationStr);
|
||||
var rangeStart = PluralKit.Utils.ParseDateTime(durationStr, true, system.Zone);
|
||||
if (rangeStart == null) throw Errors.InvalidDateTime(durationStr);
|
||||
if (rangeStart.Value.ToInstant() > now) throw Errors.FrontPercentTimeInFuture;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue