Skip to content

Commit

Permalink
Merge pull request #9 from pksadiq/wip/sadiq/minutes-interval
Browse files Browse the repository at this point in the history
OrgInterval: Add minute unit
  • Loading branch information
amberin authored Feb 20, 2025
2 parents 8de5788 + 6f32feb commit 8b17eee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/orgzly/org/datetime/OrgInterval.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
public class OrgInterval {
public enum Unit {
MINUTE, // M
HOUR, // h
DAY, // d
WEEK, // w
Expand Down Expand Up @@ -54,7 +55,10 @@ public Unit getUnit() {
}

public void setUnit(String str) {
if ("h".equals(str)) {
if ("M".equals(str)) {
unit = Unit.MINUTE;

} else if ("h".equals(str)) {
unit = Unit.HOUR;

} else if ("d".equals(str)) {
Expand All @@ -80,6 +84,8 @@ public void setUnit(Unit u) {

public String toString() {
switch (unit) {
case MINUTE:
return value + "M";
case HOUR:
return value + "h";
case DAY:
Expand Down

0 comments on commit 8b17eee

Please sign in to comment.