Skip to content

Commit

Permalink
Changed save locations and pasted the entire day array into the class…
Browse files Browse the repository at this point in the history
… :) (Hopefully I didn't break anything).
  • Loading branch information
geoffreywwang committed Feb 23, 2017
1 parent abeb036 commit f6c9682
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 48 deletions.
13 changes: 6 additions & 7 deletions src/main/java/WHS_planner/Calendar/Calendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ public class Calendar extends BorderPane {

//Days of the week
private String[] daysOfTheWeek = new String[]{"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
private Background background;

private CalendarBox[][] calendar;
private int month;
private int startDay;
private int numberOfDays;
private Node taskBox;
private AutoSave autoSave;
//Tzurs code

//Tzurs code
private CalendarHelper dayFinder = new CalendarHelper();
private IO io;
private JSON json;
Expand All @@ -60,7 +59,7 @@ public Calendar(int month, JFXButton nextButton, JFXButton prevButton, Schedule
this.month = month;
this.schedule = sc;

File saveFile = new File("Documents" + File.separator + this.month + "CalendarHolder.json");
File saveFile = new File(Main.SAVE_FOLDER + File.separator + this.month + "CalendarHolder.json");
if(!saveFile.exists()){
try {
saveFile.createNewFile();
Expand All @@ -69,7 +68,7 @@ public Calendar(int month, JFXButton nextButton, JFXButton prevButton, Schedule
}
}

io = new IO("Documents" + File.separator + this.month + "CalendarHolder.json");
io = new IO(Main.SAVE_FOLDER + File.separator + this.month + "CalendarHolder.json");

json = io.getJsonApi();
this.startDay = dayFinder.getWeekdayMonthStarts(month);
Expand Down Expand Up @@ -302,10 +301,10 @@ public CalendarBox GetCurrentCalendarBox(){
// saves calendar array as a json file at calendarHolder
void saveCalendar() {
try {
File f = new File("Documents" + File.separator + month + "CalendarHolder.json");
File f = new File(Main.SAVE_FOLDER + File.separator + month + "CalendarHolder.json");
f.delete();
f.createNewFile();
io = new IO("Documents" + File.separator + this.month + "CalendarHolder.json");
io = new IO(Main.SAVE_FOLDER + File.separator + this.month + "CalendarHolder.json");

json = io.getJsonApi();
} catch (Exception e) {
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/WHS_planner/GeneralTool.java

This file was deleted.

Loading

0 comments on commit f6c9682

Please sign in to comment.