Transaction.withStringDate constructor

Transaction.withStringDate(
  1. double amount,
  2. String when
)

Construct a Transaction instance with the given amount at the given day. @param amount the amount transferred @param when the day the transaction took place

Implementation

Transaction.withStringDate(this.amount, String when) {
  DateTime temp = DateTime.parse(when);
  this.when = DateTime(temp.year, temp.month, temp.day);
}