mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 08:40:11 +00:00
Make duration parsing case-insensitive
This commit is contained in:
parent
d3cf382e3b
commit
6fa76e85c4
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ namespace PluralKit.Core
|
||||||
foreach (Match match in Regex.Matches(str, "(\\d{1,6})(\\w)"))
|
foreach (Match match in Regex.Matches(str, "(\\d{1,6})(\\w)"))
|
||||||
{
|
{
|
||||||
var amount = int.Parse(match.Groups[1].Value);
|
var amount = int.Parse(match.Groups[1].Value);
|
||||||
var type = match.Groups[2].Value;
|
var type = match.Groups[2].Value.ToLowerInvariant();
|
||||||
|
|
||||||
if (type == "w") d += Duration.FromDays(7) * amount;
|
if (type == "w") d += Duration.FromDays(7) * amount;
|
||||||
else if (type == "d") d += Duration.FromDays(1) * amount;
|
else if (type == "d") d += Duration.FromDays(1) * amount;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue