Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Date arg from class To Field of Meeting; Update Calendar to Schedule #211

Merged
merged 10 commits into from
Nov 4, 2020
Merged

Conversation

MerlinLim
Copy link

@MerlinLim MerlinLim commented Nov 4, 2020

Fixes #163
Fixes #137

  • Add Time class
  • To field now only takes HH:mm
  • Remove Index from Calendar panel and rename to schedule

@MerlinLim MerlinLim added this to the mid-v1.4 milestone Nov 4, 2020
@MerlinLim MerlinLim self-assigned this Nov 4, 2020
@MerlinLim MerlinLim added this to PRs Pending Approvals in Productiv via automation Nov 4, 2020
@codecov-io
Copy link

codecov-io commented Nov 4, 2020

Codecov Report

Merging #211 into master will increase coverage by 0.19%.
The diff coverage is 61.53%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #211      +/-   ##
============================================
+ Coverage     53.72%   53.91%   +0.19%     
- Complexity      751      758       +7     
============================================
  Files           166      167       +1     
  Lines          3131     3144      +13     
  Branches        347      344       -3     
============================================
+ Hits           1682     1695      +13     
  Misses         1341     1341              
  Partials        108      108              
Impacted Files Coverage Δ Complexity Δ
...edu/address/logic/commands/meeting/AddCommand.java 100.00% <ø> (ø) 8.00 <0.00> (ø)
...c/main/java/seedu/address/model/util/DateTime.java 86.95% <ø> (ø) 11.00 <0.00> (ø)
.../java/seedu/address/model/util/SampleDataUtil.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...java/seedu/address/ui/CalendarDeliverableCard.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../main/java/seedu/address/ui/CalendarListPanel.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ain/java/seedu/address/ui/CalendarMeetingCard.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
src/main/java/seedu/address/model/util/Time.java 81.25% <81.25%> (ø) 7.00 <7.00> (?)
...a/seedu/address/model/meeting/meeting/Meeting.java 88.67% <100.00%> (ø) 23.00 <2.00> (ø)
...n/java/seedu/address/model/meeting/meeting/To.java 80.00% <100.00%> (ø) 5.00 <1.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 849c30a...4a8f7ce. Read the comment docs.

Include labels for schedule
LocalDateTime dateFrom = from.getLocalDateTime();
LocalDateTime dateTo = to.getLocalDateTime();
LocalTime dateFrom = from.getLocalDateTime().toLocalTime();
LocalTime dateTo = to.getLocalTime();

return dateFrom.compareTo(dateTo) <= 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its better to make it strictly less than.

public static final String TIME_REGEX = "(([0-1]\\d)|(2[0-3])):([0-5]\\d)";
public static final String MESSAGE_CONSTRAINTS =
"Time should be in the format of HH:mm, "
+ "minute must start with a leading zero.";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps its clearer to state that single digit hour and minute must start with a leading zero

@@ -20,7 +19,7 @@
+ "Note: Single digit month, day, and minute must start with a leading zero.";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include hour here as well

"Time should be in the format of HH:mm, "
+ "minute must start with a leading zero.";

public static final String VALIDATION_REGEX = String.format("%s", TIME_REGEX);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as TIME_REGEX?

editedMeeting = new MeetingBuilder(MEETING_A)
.withTo(VALID_TO_B).build();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think VALID_TO_B should still work since its updated to 12:00

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope it will throw false, MEETING_A has a time of 14:00.

@@ -68,10 +63,10 @@ public void isValidFromAndTo() {
assertTrue(Meeting.isValidFromAndTo(new From(VALID_FROM_A), new To(VALID_TO_A)));

// FROM = TO -> returns true
assertTrue(Meeting.isValidFromAndTo(new From(VALID_FROM_A), new To(VALID_FROM_A)));
assertTrue(Meeting.isValidFromAndTo(new From(VALID_FROM_B), new To(VALID_TO_B)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change the part in front this will now return false.

}

@Test
void parseFail() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to change the comments here

@@ -11,7 +11,6 @@
import java.util.Date;

public class DateTime implements Comparable<DateTime> {
public static final String TIME_REGEX = "(([0-1]\\d)|(2[0-3])):([0-5]\\d)";
public static final String DATE_REGEX = "(([0-2]\\d)|(3[0-1]))-((0[1-9])|(1[0-2]))-(\\d{4})";
public static final String EARLIEST_DATE_STRING = "01-01-2019 00:00";
public static final String MESSAGE_CONSTRAINTS =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should shift this message to the deadline and from class and state explicitly that deadline/from should be in the format ...


public class Time implements Comparable<Time> {
public static final String TIME_REGEX = "(([0-1]\\d)|(2[0-3])):([0-5]\\d)";
public static final String MESSAGE_CONSTRAINTS =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above I think its better to shift this message into to class and say To should be in the format ...

@@ -49,8 +50,8 @@ public Meeting(Title title, OptionalDescription description, From from, To to,
* Returns true if From is earlier than To chronologically.
*/
public static boolean isValidFromAndTo (From from, To to) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message for this prob needs to change also cos "to" is no longer a date.

Copy link

@shadowezz shadowezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Productiv automation moved this from PRs Pending Approvals to PRs approved / Ready for Testing Nov 4, 2020
@MerlinLim MerlinLim merged commit dc34bdf into AY2021S1-CS2103T-F11-2:master Nov 4, 2020
Productiv automation moved this from PRs approved / Ready for Testing to Issues Done / PRs Merged (After Testing) Nov 4, 2020
@MerlinLim MerlinLim changed the title Remove Date arg from class To Field of Meeting Remove Date arg from class To Field of Meeting; Update Calendar to Schedule Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Productiv
Issues Done / PRs Merged (After Testing)
3 participants