Skip to content

Commit

Permalink
Add appropriate timestamp and cell scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPickles committed Apr 9, 2017
1 parent fed9cb3 commit 80c0eaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 0 additions & 5 deletions sheets436/src/main/java/edu/umd/cmsc436/sheets/Sheets.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ protected void showGooglePlayErrorDialog () {
apiAvailability.getErrorDialog(hostActivity, statusCode, host.getRequestCode(Action.REQUEST_PLAY_SERVICES)).show();
}

public static float unixToSheetsEpoch(long milliseconds) {
// days between 1/1/1900 and 1/1/1970, horribly inflexible timezone adjustment, then number of milliseconds in a day
return 25569 + ((milliseconds-14400000)/86400000f);
}

public interface Host {

int getRequestCode(Action action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
import com.google.api.services.sheets.v4.model.ValueRange;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;

/**
* Background task to write the data
Expand Down Expand Up @@ -103,13 +106,12 @@ private void writeToPrivate(WriteData wd) throws IOException {
rowIdx++;
}
}
// DON"T hardcode the E part TODO
String updateCell = wd.testType.toId() + "!A" + rowIdx + ":E" + rowIdx;

String updateCell = wd.testType.toId() + "!A" + rowIdx + ":" + columnToLetter(wd.trials.length + 2) + rowIdx;
List<List<Object>> values = new ArrayList<>();
List<Object> row = new ArrayList<>();
row.add(wd.userId);
// TODO put a timestamp here
row.add(2943756);
row.add(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).format(new Date()));
for (float value : wd.trials) {
row.add(value);
}
Expand Down

0 comments on commit 80c0eaf

Please sign in to comment.