Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix wrong hour placeholder calculation #296

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ target
build
/.gradle/
/.idea
/bin
.vscode
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ java {


group = 'me.playbosswar.com'
version = '8.9.0'
version = '8.9.1'
description = 'CommandTimer'

repositories {
Expand Down Expand Up @@ -64,7 +64,7 @@ publishing {
maven(MavenPublication) {
groupId = 'me.playbosswar.com'
artifactId = 'commandtimer-java21'
version = '8.9.0'
version = '8.9.1'

from components.java
}
Expand Down
4 changes: 2 additions & 2 deletions java17-build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ java {


group = 'me.playbosswar.com'
version = '8.9.0'
version = '8.9.1'
description = 'CommandTimer'

repositories {
Expand Down Expand Up @@ -63,7 +63,7 @@ publishing {
maven(MavenPublication) {
groupId = 'me.playbosswar.com'
artifactId = 'commandtimer-java17'
version = '8.9.0'
version = '8.9.1'

from components.java
}
Expand Down
4 changes: 2 additions & 2 deletions java8-build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ java {
}

group = 'me.playbosswar.com'
version = '8.9.0'
version = '8.9.1'
description = 'CommandTimer'

repositories {
Expand Down Expand Up @@ -70,7 +70,7 @@ publishing {
maven(MavenPublication) {
groupId = 'me.playbosswar.com'
artifactId = 'commandtimer-java8'
version = '8.9.0'
version = '8.9.1'

from components.java
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/playbosswar/com/utils/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static String getTimeString(int seconds, String format) {
Duration duration = Duration.standardSeconds(seconds);

int days = (int) duration.getStandardDays();
int hours = (int) (duration.getStandardHours() % 48);
int hours = (int) (duration.getStandardHours() % 24);
int minutes = (int) (duration.getStandardMinutes() % 60);
int remainingSeconds = (int) (duration.getStandardSeconds() % 60);

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
main: me.playbosswar.com.CommandTimerPlugin
name: "CommandTimer"
version: "8.9.0"
version: "8.9.1"
description: "Schedule commands like you want"
author: PlayBossWar
api-version: 1.13
softdepend: [ PlaceholderAPI ]
softdepend: [PlaceholderAPI]

commands:
commandtimer:
usage: /<command>
aliases: [ cmt ]
description: List all commands
aliases: [cmt]
description: List all commands
6 changes: 6 additions & 0 deletions src/test/java/utils/ToolsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@ public void shouldReturnCorrectTime11() {
String result = Tools.getTimeString(172871, "DD:HH:mm:ss");
assertEquals("02:00:01:11", result);
}

@Test
public void shouldReturnCorrectTime12() {
String result = Tools.getTimeString(86400, "DD:HH:mm:ss");
assertEquals("01:00:00:00", result);
}
}
Loading