Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit 445aedb

Browse files
committed
UX changes
1 parent 2f2fa53 commit 445aedb

3 files changed

Lines changed: 17 additions & 16 deletions

File tree

ProjectManager/src/Back/Date.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public Date(){
1818
}
1919

2020
public void printDate(){
21-
System.out.println(year + "/" + month + "/" + day );
21+
System.out.println( day + "-" + month + "-" + year );
2222
}
2323

2424
public String getDate(){
25-
return(year + "/" + month + "/" + day);
25+
return(day + "-" + month + "-" + year);
2626
}
2727

2828
public boolean compareDate(Date d){ // if : else also no variable because ma memory

ProjectManager/src/Back/Main.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public static Project createProject(Scanner sc, ArrayList<Project> oArrayList, H
6767
System.out.println("---------------------------------------------------------------");
6868
System.out.println("there might have been an error let's check that again");
6969
System.out.println("---------------------------------------------------------------");
70-
pStartDate = scanDate( sc, start );
71-
pEndDate = scanDate( sc, end );
70+
pStartDate = scanDate( sc, start.toUpperCase() );
71+
pEndDate = scanDate( sc, end.toUpperCase() );
7272
}
7373
int pid = 0;
7474
if (oArrayList.isEmpty() ) pid = 0;
@@ -89,16 +89,17 @@ public static Date scanDate( Scanner sc, String dateType ) throws ArrayIndexOutO
8989
try {
9090
String todayString = sc.nextLine();
9191
String[] todayStringArr = todayString.split("-");
92-
if (todayStringArr.length > 3) return scanDate(sc, dateType);
92+
if (todayStringArr.length > 3) return scanDate(sc,dateType);
9393
Calendar cals = parseTimestamp(todayString);
94-
9594
scDate = new Date(Integer.parseInt(todayStringArr[2]), Integer.parseInt(todayStringArr[1]),Integer.parseInt(todayStringArr[0])) ;
9695
//pDate.printDate();
9796

9897
} catch( ArrayIndexOutOfBoundsException | InputMismatchException | NumberFormatException | ParseException e) {
99-
98+
System.out.println("---------------------------------------------------------------");
99+
System.out.println("| There might have been a little mistake |");
100+
System.out.println("---------------------------------------------------------------");
101+
dateType = dateType.toUpperCase();
100102
return scanDate(sc, dateType);
101-
102103
}
103104

104105
return scDate;
@@ -130,7 +131,7 @@ public static String getPNameString(ArrayList<Project> oArrayList, Scanner sc, H
130131
return pname;
131132
}
132133

133-
public static Date getToday() {
134+
public synchronized static Date getToday() {
134135
//comment
135136
System.out.println("---------------------------------------------------------------");
136137
System.out.println("|This Program uses LocalDate so the date might be one day off.|");
@@ -159,7 +160,6 @@ public synchronized static void looper(ArrayList<Project> oArrayList, HashSet<St
159160
try {
160161
Thread.sleep(500);
161162
} catch (InterruptedException e) {
162-
// TODO Auto-generated catch block
163163
e.printStackTrace();
164164
}
165165

@@ -192,18 +192,19 @@ public synchronized static void looper(ArrayList<Project> oArrayList, HashSet<St
192192
case 3:/**this lists all listed projects */
193193
System.out.println( "---------------------------------------------------------------" );
194194
System.out.println( "All listed projects like id|name|start|end" );
195+
System.out.println( "Remember dd-MM-yyyy");
195196
System.out.println( "---------------------------------------------------------------" );
196197
for ( int i = 0; i < oArrayList.size(); i++ ){
197198
oArrayList.get(i).printProject();
198199
}
199200
if( oArrayList.isEmpty() ) System.out.println("no projects");
200201
System.out.println( "---------------------------------------------------------------" );
201-
System.out.println("");
202202
break;
203203

204204
case 4:/**this lists all current projects */
205205
System.out.println( "---------------------------------------------------------------" );
206206
System.out.println( "All current projects like id|name|start|end" );
207+
System.out.println( "Remember dd-MM-yyyy");
207208
System.out.println( "---------------------------------------------------------------" );
208209
count = 0;
209210
for (int i = 0; i < oArrayList.size(); i++ ) {
@@ -218,6 +219,7 @@ public synchronized static void looper(ArrayList<Project> oArrayList, HashSet<St
218219
case 5:/**this lists all upcoming projects */
219220
System.out.println( "---------------------------------------------------------------" );
220221
System.out.println( "All upcoming projects like id|name|start|end" );
222+
System.out.println( "Remember dd-MM-yyyy");
221223
System.out.println( "---------------------------------------------------------------" );
222224
count = 0;
223225
for ( int i = 0; i < oArrayList.size(); i++ ) {
@@ -232,6 +234,7 @@ public synchronized static void looper(ArrayList<Project> oArrayList, HashSet<St
232234
case 6:/**this lists all past projects */
233235
System.out.println("---------------------------------------------------------------");
234236
System.out.println("All past projects like id|name|start|end");
237+
System.out.println("Remember dd-MM-yyyy");
235238
System.out.println("---------------------------------------------------------------");
236239
count = 0;
237240
for (int i = 0; i < oArrayList.size(); i++) {
@@ -290,7 +293,7 @@ public synchronized static void looper(ArrayList<Project> oArrayList, HashSet<St
290293
System.out.println("success");
291294
System.out.println("---------------------------------------------------------------\n");
292295
}
293-
else System.out.println("there was a an issue \n --------------------------------------------------------------- ");
296+
else System.out.println("unexpected error \n --------------------------------------------------------------- ");
294297
break;
295298

296299
case 10: /**this is the exit */

ProjectManager/src/Back/Project.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ public class Project {
66
private Date pStartDate;
77
private Date pEndDate;
88

9-
public Project(){
10-
//nothing eh?
11-
//I hope it works
12-
}
9+
public Project(){}
10+
1311
public Project(int id, String pName, Date pStartDate, Date pEndDate){
1412
this.id = id;
1513
this.pName = pName;

0 commit comments

Comments
 (0)