cs2103aug2014-w10-4j / main

ChirpTask
3 stars 1 forks source link

When you add a deadline task from Google, the time is not recognised. #125

Closed newbishme closed 9 years ago

newbishme commented 9 years ago

We did not plan this from the beginning but since we support setting time in deadline tasks, we should look into this.

Current version sets it to 00:00 [default of Task](The date that is on the DeadlineTask/Task object) Older version sets it to 23:59 [default of Task, too]

What should be the best way to solve this? (Adding deadline task from Google to get the Time recognised)

@cs2103aug2014-w10-4j/developers

newbishme commented 9 years ago

@HaLinhh anyway for me to call the DateParser to try to parse the information?

HaLinhh commented 9 years ago

I think DateParser's parseDate method is public, so it can be used from Google. Would it be better to call InputParser? That way you don't have to parse the string to get the keyword?

newbishme commented 9 years ago

Yes from InputParser will be better. Which method(s) should I be looking at?

HaLinhh commented 9 years ago

I think you can try add addt in front of the task and pass to receiveInput(String). It is a public method. Alternatively you can try processAdd(command, parameter), but it is now private.

newbishme commented 9 years ago

It being a public method is not good enough as now I have to new an InputParser object from GoogleComponent.

Also, receiveInput does not return anything so I cannot receive anything.

I think what we need is a method in InputParser that other components can just call without thinking of what to do.

Similar to this method: getTaskFromString(String) but it should do all the parsing with all the date(s). To identify what type of task to parse, I could further specify a String parameter, taskType.

getTaskFromString(String desc, String taskType);

Usage: getTaskFromString(desc, Task.TASK_DEADLINE) for example.

pyonghe commented 9 years ago

Status update on this issue?

HaLinhh commented 9 years ago

I updated the code and ran the test. Please tell me if I have overlooked any test cases.

newbishme commented 9 years ago

@HaLinhh the code you uploaded is very buggy, im fixing it. in the meantime, could you remove the date from the deadline task? only append the time.

For example: "by 15:00" instead of "by 15:00 10/11"