@@ -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 */
0 commit comments