package com.example.eg17_2;

import java.sql.Date;
import java.text.SimpleDateFormat;

public class TodoItem {
	 
	 private String mTask;
	 
	 private Date mCreated;
	 
	 public String getTask(){
		 return mTask;
	 }
	 
	 public Date getCreated(){
		 return mCreated;
	 }
	 
	 public TodoItem(String task){
		 this(task,new Date(System.currentTimeMillis()));
	 }
	 
	 public TodoItem(String task, Date created){
		 mTask=task;
		 mCreated=created;
	 }
	 
	 @Override
	 public String toString(){
		 SimpleDateFormat sdf=new SimpleDateFormat("dd/mm/yy");
		 String dateString= sdf.format(mCreated);
		 return "("+ dateString+ ")" + mTask;
	 }
	 
}
