Skip to content

Commit 4461f45

Browse files
authored
Merge pull request #132 from alfaloo/debug
Bug fix
2 parents 0cbe212 + 7cb43ce commit 4461f45

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

src/main/java/seedu/address/logic/parser/ParserUtil.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ public static Set<Tag> parseTags(Collection<String> tags) throws ParseException
188188
public static AppointmentDateTime parseAppointmentDateTime(String apptDateTime) throws ParseException {
189189
requireNonNull(apptDateTime);
190190
String trimmedDate = apptDateTime.trim();
191-
if (!AppointmentDateTime.isValidDate(trimmedDate)) {
191+
String datetime = trimmedDate.substring(0, 11) + trimmedDate.substring(11).strip();
192+
if (!AppointmentDateTime.isValidDate(datetime)) {
192193
throw new ParseException(AppointmentDateTime.MESSAGE_CONSTRAINTS);
193194
}
194-
return new AppointmentDateTime(trimmedDate);
195+
return new AppointmentDateTime(datetime);
195196
}
196197
}

src/main/java/seedu/address/model/UserPrefs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public class UserPrefs implements ReadOnlyUserPrefs {
1515

1616
private GuiSettings guiSettings = new GuiSettings();
17-
private Path addressBookFilePath = Paths.get("data" , "medicli.json");
17+
private Path addressBookFilePath = Paths.get("data" , "addressbook.json");
1818

1919
/**
2020
* Creates a {@code UserPrefs} with default values.

src/main/java/seedu/address/storage/JsonAdaptedAppointment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public JsonAdaptedAppointment(@JsonProperty("doctorNric") String doctorNric,
4141
public JsonAdaptedAppointment(Appointment source) {
4242
doctorNric = source.getDoctorNric().toString();
4343
patientNric = source.getPatientNric().toString();
44-
appointmentDateTime = source.getAppointmentDateTime().appointmentDateTime.toString();
44+
appointmentDateTime = source.getAppointmentDateTime().toString();
4545
appointmentId = source.getAppointmentId().toString();
4646
}
4747

src/test/data/JsonUserPrefsStorageTest/ExtraValuesUserPref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"z" : 99
1010
}
1111
},
12-
"addressBookFilePath" : "medicli.json"
12+
"addressBookFilePath" : "addressbook.json"
1313
}

src/test/data/JsonUserPrefsStorageTest/TypicalUserPref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"y" : 100
88
}
99
},
10-
"addressBookFilePath" : "medicli.json"
10+
"addressBookFilePath" : "addressbook.json"
1111
}

src/test/java/seedu/address/logic/LogicManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class LogicManagerTest {
5050
@BeforeEach
5151
public void setUp() {
5252
JsonAddressBookStorage addressBookStorage =
53-
new JsonAddressBookStorage(temporaryFolder.resolve("mediCli.json"));
53+
new JsonAddressBookStorage(temporaryFolder.resolve("addressbook.json"));
5454
JsonUserPrefsStorage userPrefsStorage = new JsonUserPrefsStorage(temporaryFolder.resolve("userPrefs.json"));
5555
StorageManager storage = new StorageManager(addressBookStorage, userPrefsStorage);
5656
logic = new LogicManager(model, storage);

src/test/java/seedu/address/storage/JsonAdaptedAppointmentTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class JsonAdaptedAppointmentTest {
2525
private static final String VALID_NRIC_1 = APPOINTMENT_1.getPatientNric().toString();
2626
private static final String VALID_NRIC_2 = APPOINTMENT_1.getDoctorNric().toString();
2727
private static final String VALID_DATE_A = APPOINTMENT_1.getAppointmentDateTime().toString();
28-
private static final String VALID_DATE_B = APPOINTMENT_1.getAppointmentDateTime().appointmentDateTime.toString();
28+
private static final String VALID_DATE_B = APPOINTMENT_1.getAppointmentDateTime().toString();
2929
private static final String VALID_APPOINTMENT_ID = APPOINTMENT_1.getAppointmentId().toString();
3030

3131
/**

src/test/java/seedu/address/storage/JsonUserPrefsStorageTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void readUserPrefs_extraValuesInFile_extraValuesIgnored() throws DataLoad
7373
private UserPrefs getTypicalUserPrefs() {
7474
UserPrefs userPrefs = new UserPrefs();
7575
userPrefs.setGuiSettings(new GuiSettings(1000, 500, 300, 100));
76-
userPrefs.setAddressBookFilePath(Paths.get("medicli.json"));
76+
userPrefs.setAddressBookFilePath(Paths.get("addressbook.json"));
7777
return userPrefs;
7878
}
7979

0 commit comments

Comments
 (0)