forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-46783 Global move dependencies to shared (sakaiproject#10699)
* SAK-46783 - Collapse kernel-common and kernel-private into kernel-api Move the shared kernel-util bits into kernel-api Application specific things stay in kernel-util Co-authored-by: Charles Severance <[email protected]>
- Loading branch information
Showing
117 changed files
with
325 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
94 changes: 47 additions & 47 deletions
94
.../org/sakaiproject/util/TimeSheetUtil.java → .../org/sakaiproject/util/TimeSheetUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
package org.sakaiproject.util; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.sakaiproject.timesheet.api.TimeSheetEntry; | ||
|
||
public class TimeSheetUtil { | ||
|
||
public String intToTime(int time) { | ||
String timeReturn = ""; | ||
if(time >= 60) { | ||
timeReturn = timeReturn.concat((time/60)+"h").concat(" "); | ||
timeReturn = timeReturn.concat((time%60)+"m"); | ||
}else if(time>0 && time<60) { | ||
timeReturn = time+"m"; | ||
} | ||
return timeReturn; | ||
} | ||
|
||
public int timeToInt(String time) { | ||
int timeParseInt=0; | ||
if(StringUtils.isNotBlank(time)) { | ||
String timeSheet[] = time.split("h|H"); | ||
if(timeSheet.length > 1) { | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60; | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[1].split("m|M")[0].trim()); | ||
}else { | ||
if(timeSheet[0].contains("m") || timeSheet[0].contains("M")) { | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].split("m|M")[0].trim()); | ||
}else { | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60; | ||
} | ||
} | ||
} | ||
return timeParseInt; | ||
} | ||
|
||
public String getTotalTimeSheet(List<TimeSheetEntry> ats) { | ||
int totalTime = 0; | ||
for (TimeSheetEntry timeSheet : ats) { | ||
totalTime = totalTime + timeToInt(timeSheet.getDuration()); | ||
} | ||
|
||
return intToTime(totalTime); | ||
} | ||
} | ||
package org.sakaiproject.util; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.sakaiproject.timesheet.api.TimeSheetEntry; | ||
|
||
public class TimeSheetUtil { | ||
|
||
public String intToTime(int time) { | ||
String timeReturn = ""; | ||
if(time >= 60) { | ||
timeReturn = timeReturn.concat((time/60)+"h").concat(" "); | ||
timeReturn = timeReturn.concat((time%60)+"m"); | ||
}else if(time>0 && time<60) { | ||
timeReturn = time+"m"; | ||
} | ||
return timeReturn; | ||
} | ||
|
||
public int timeToInt(String time) { | ||
int timeParseInt=0; | ||
if(StringUtils.isNotBlank(time)) { | ||
String timeSheet[] = time.split("h|H"); | ||
if(timeSheet.length > 1) { | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60; | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[1].split("m|M")[0].trim()); | ||
}else { | ||
if(timeSheet[0].contains("m") || timeSheet[0].contains("M")) { | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].split("m|M")[0].trim()); | ||
}else { | ||
timeParseInt = timeParseInt + Integer.parseInt(timeSheet[0].trim())*60; | ||
} | ||
} | ||
} | ||
return timeParseInt; | ||
} | ||
|
||
public String getTotalTimeSheet(List<TimeSheetEntry> ats) { | ||
int totalTime = 0; | ||
for (TimeSheetEntry timeSheet : ats) { | ||
totalTime = totalTime + timeToInt(timeSheet.getDuration()); | ||
} | ||
|
||
return intToTime(totalTime); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.