-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
implemented salary info method #1255
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, just some style comments
LocalDate localDateFrom = LocalDate.parse(dateFrom, formatter); | ||
LocalDate localDateTo = LocalDate.parse(dateTo, formatter); | ||
for (String name : names) { | ||
result.append("\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use operating system independent symbol for new line
result.append("\n"); | |
result.append(System.lineSeparator()); |
if ((entryDate.isEqual(localDateFrom) | ||
|| entryDate.isAfter(localDateFrom)) | ||
&& (entryDate.isEqual(localDateTo) | ||
|| entryDate.isBefore(localDateTo)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use !entryDate.isAfter() and !entryDate.isBefore() to simlify expression by omitting isEqual conditions
* Integer.parseInt(elements[INCOME_PER_HOURS_INDEX]); | ||
} | ||
} | ||
result.append(name).append(SEPARATOR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move here append from line 22 to have all of them in one place
private static final String HEADER = "Report for period "; | ||
private static final String SEPARATOR = " - "; | ||
private static final String DATA_SEPARATOR = " "; | ||
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatter is also not going to be changed
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy"); | |
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done
result.append(System.lineSeparator()) | ||
.append(name).append(SEPARATOR) | ||
.append(moneyEarned); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.