You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
793 B
24 lines
793 B
import java.text.DateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDateTime;
|
|
import java.util.Locale;
|
|
|
|
public class PackageInfo {
|
|
private String name;
|
|
private String note;
|
|
private double price;
|
|
private double weight;
|
|
private boolean delivered;
|
|
private LocalDateTime expectedDate;
|
|
|
|
@Override
|
|
public String toString() {
|
|
DateFormat date = new SimpleDateFormat("yyyy-mm-dd hh:mm");
|
|
//date.setCalendar(expectedDate);
|
|
String isDelivered = delivered ? "yes" : "no";
|
|
//add remaining date
|
|
return "Name: " + name + "\n" + "Notes: " + note + "\n" + "Price: " + price + "\n" + "Weight: " + weight + "\n" + "Expected Delivery Date: " + expectedDate + "\n" + "Delivered? " + isDelivered;
|
|
}
|
|
}
|