diff --git a/src/de/steamwar/bungeecore/commands/BanCommand.java b/src/de/steamwar/bungeecore/commands/BanCommand.java index 9382031e..9ac7ff89 100644 --- a/src/de/steamwar/bungeecore/commands/BanCommand.java +++ b/src/de/steamwar/bungeecore/commands/BanCommand.java @@ -38,7 +38,7 @@ public class BanCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { if(args.length < 3){ - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/ban [Spieler] [dd.mm.yyyy oder perma] [Grund]"); + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/ban [Spieler] [dd.mm.yyyy oder dd.mm.yyyy_hh:mm oder perma] [Grund]"); return; } @@ -63,13 +63,19 @@ public class BanCommand extends BasicCommand { if(arg.equalsIgnoreCase("perma")) { return Timestamp.from(Instant.ofEpochSecond(946674800)); }else{ - SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy"); + SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy_HH:mm"); try{ Date parsedDate = dateFormat.parse(arg); return new java.sql.Timestamp(parsedDate.getTime()); }catch(ParseException e){ - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUngültige Zeitangabe."); - return null; + dateFormat = new SimpleDateFormat("dd.MM.yyyy"); + try{ + Date parsedDate = dateFormat.parse(arg.split("_")[0]); + return new java.sql.Timestamp(parsedDate.getTime()); + }catch(ParseException exception){ + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cUngültige Zeitangabe."); + return null; + } } } } diff --git a/src/de/steamwar/bungeecore/commands/MuteCommand.java b/src/de/steamwar/bungeecore/commands/MuteCommand.java index f3421aab..dc0d681e 100644 --- a/src/de/steamwar/bungeecore/commands/MuteCommand.java +++ b/src/de/steamwar/bungeecore/commands/MuteCommand.java @@ -34,7 +34,7 @@ public class MuteCommand extends BasicCommand { @Override public void execute(CommandSender sender, String[] args) { if(args.length < 3){ - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/mute [Spieler] [dd.mm.yyyy oder perma] [Grund]"); + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "/mute [Spieler] [dd.mm.yyyy oder dd.mm.yyyy_hh:mm oder perma] [Grund]"); return; }