Skip to content

Commit

Permalink
Hotfix substitute appended text
Browse files Browse the repository at this point in the history
  • Loading branch information
PAException committed Nov 22, 2023
1 parent c3a17fb commit 52446a5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ public void updateSubstitutes() {

//If the row does not contain a className then this row is used to extend the text from
// the previous substitute, so it needs to be added to the latest substitute
String className = row.child(0).text();
if (!substitutes.isEmpty() && !className.matches("(.*)[0-9](.*)")) {
String lesson = row.child(1).text();
if (!substitutes.isEmpty() && !lesson.matches("(.*)[0-9](.*)")) {
this.appendTextOnLastSubstitute(row, substitutes);
String appendedText = substitutes.get(substitutes.size() - 1).getText();

Expand Down Expand Up @@ -274,7 +274,7 @@ private List<SubstituteDTO> createSubstituteDTOs(Element row, Date currentDate)
List<SubstituteDTO> dtos = new ArrayList<>();
SubstituteDTO dto = new SubstituteDTO();
dto.setDate(currentDate);
dto.setClassName(row.child(0).text());
if (row.child(0).text().matches("(.*)[0-9](.*)")) dto.setClassName(row.child(0).text());
String lessons = row.child(1).text().replace(" ", "");
if (lessons.contains("-")) { //5 - 6, //3 - 6
int low = Integer.parseInt(lessons.substring(0, lessons.indexOf("-"))),
Expand Down

0 comments on commit 52446a5

Please sign in to comment.