Skip to content

Commit

Permalink
Time ago reported incorrectly if watch face under certain conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktind committed Dec 10, 2014
1 parent 1b0b6fa commit 313e98b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/nightscout/android/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ private String getSGVStringByUnit(int sgv, TrendArrow trend){
else
sgvStr=String.valueOf(sgv);
return (sgv!=-1)?
(SpecialValue.isSpecialValue(sgv))?SpecialValue.getEGVSpecialValue(sgv).toString():sgvStr+" "+trend.symbol():"---";
(SpecialValue.isSpecialValue(sgv))?
SpecialValue.getEGVSpecialValue(sgv).toString():sgvStr+" "+trend.symbol():"---";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public void sendDownload(int bgMgdl, TrendArrow trend, long recordTime){
String bgStr = (units == GlucoseUnits.MGDL) ?
String.valueOf(bgMgdl) : String.format("%.1f", bgMgdl * Constants.MG_DL_TO_MMOL_L);

lastRecordTime = recordTime;
lastBgInMgdl = bgMgdl;
lastTrend = trend;
recordTime = DateTimeZone.getDefault().convertUTCToLocal(recordTime);
PebbleDictionary dictionary = buildDictionary(trend, bgStr, (int) (recordTime/1000),
(int) (DateTimeZone.getDefault().convertUTCToLocal(new DateTime().getMillis())/1000), deltaStr,
String.valueOf(MainActivity.batLevel), pwdName);
sendDownload(dictionary);
currentReading = dictionary;
lastBgInMgdl = bgMgdl;
lastTrend = trend;
lastRecordTime = recordTime;
sendDownload(dictionary);
}

public void resendDownload(){
Expand Down

0 comments on commit 313e98b

Please sign in to comment.