20
20
21
21
import org .apache .commons .lang3 .StringUtils ;
22
22
import org .threeten .bp .Duration ;
23
- import org .threeten .bp .LocalDate ;
24
23
import org .threeten .bp .LocalDateTime ;
25
24
import org .threeten .bp .format .DateTimeFormatter ;
26
25
@@ -150,7 +149,6 @@ private void applyInfos(Student st, Isee isee) {
150
149
TextView navSubtitle = headerLayout .findViewById (R .id .nav_subtitle );
151
150
navSubtitle .setText (st .getStudentID ());
152
151
studentId .setText (st .getStudentID ());
153
- LocalDate date = st .getBirthDate ();
154
152
birthDate .setText ((st .getBirthDate ().format (formatter )));
155
153
birthPlace .setText (st .getBirthPlace ());
156
154
if (isee == null ) isee_field .setText (getResources ().getString (R .string .isee_not_available ));
@@ -162,9 +160,13 @@ private void applyInfos(Student st, Isee isee) {
162
160
courseYear .setText (getResources ().getString (R .string .year_corse_profile , st .getCourseYear () + "°" ));
163
161
else {
164
162
String year = st .getCourseYear ();
165
- if (StringUtils .isNumeric (st .getCourseYear ()) && Integer .parseInt (year ) <= 3 )
166
- year = year + "rd" ;
167
- else year = year + "th" ;
163
+ if (StringUtils .isNumeric (st .getCourseYear ())) {
164
+ int number = Integer .parseInt (year );
165
+ if (number == 1 ) year = year + "st" ;
166
+ else if (number == 2 ) year = year + "nd" ;
167
+ else if (number == 3 ) year = year + "rd" ;
168
+ else year = year + "th" ;
169
+ }
168
170
courseYear .setText (getResources ().getString (R .string .year_corse_profile , year ));
169
171
}
170
172
studentStatus .setText (st .getStudentStatus ());
0 commit comments