Skip to content

Commit

Permalink
Merge branch 'master' of github.com:poundifdef/VirginMobileMinutesChe…
Browse files Browse the repository at this point in the history
…cker
  • Loading branch information
poundifdef committed Jul 31, 2011
2 parents b8c98d1 + 8786ca3 commit 550607c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion VirginMobileMinutesChecker/src/com/baker/vm/VMAccount.java
Expand Up @@ -170,7 +170,9 @@ public Calendar getChargedOnCal()
// This won't throw NumberFormatExceptions because the matches must be digits
cal = new GregorianCalendar(Integer.parseInt("20" + m.group(3)),
Integer.parseInt(m.group(1)) - 1,
Integer.parseInt(m.group(2)));
Integer.parseInt(m.group(2)),
23,
59);
}

return cal;
Expand Down
Expand Up @@ -55,9 +55,11 @@ protected void updateModel(final VMAccount iAccount)
{
final Calendar end = account.getChargedOnCal();
final Calendar start = (Calendar) end.clone();
start.set(Calendar.MONTH, end.get(Calendar.MONTH) - 1);
start.add(Calendar.MONTH, -1);
start.set(Calendar.HOUR_OF_DAY, 0);
start.set(Calendar.MINUTE, 0);
final Calendar now = new GregorianCalendar();

final long total = end.getTimeInMillis() - start.getTimeInMillis();
final long millis = now.getTimeInMillis() - start.getTimeInMillis();

Expand All @@ -74,7 +76,7 @@ protected void updateModel(final VMAccount iAccount)

private String toString(final Calendar end)
{
return end.get(Calendar.MONTH) + "/" + end.get(Calendar.DAY_OF_MONTH) + "/" + end.get(Calendar.YEAR);
return end.get(Calendar.MONTH) + "/" + end.get(Calendar.DAY_OF_MONTH) + "/" + end.get(Calendar.YEAR) + " " + end.get(Calendar.HOUR_OF_DAY) + ":" + end.get(Calendar.MINUTE);
}

/**
Expand Down

0 comments on commit 550607c

Please sign in to comment.