Skip to content

Commit b948864

Browse files
committed
Add day of the week to the table view, #1272
1 parent 1fa6c5d commit b948864

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • android_app/app/src/main/java/com/health/openscale/ui/screen/table

android_app/app/src/main/java/com/health/openscale/ui/screen/table/TableScreen.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ fun TableScreen(
191191
emptyList()
192192
} else {
193193
val dateFormatterDate = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault())
194+
val dateFormatterDayOfWeek = SimpleDateFormat("EE", Locale.getDefault())
194195
val dateFormatterTime = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.getDefault())
195196

196197
enrichedMeasurements.map { enrichedItem ->
197198
val ts = enrichedItem.measurementWithValues.measurement.timestamp
199+
val date = Date(ts)
198200

199201
val cellValues: Map<Int, TableCellData?> = displayedTypes.associate { colType ->
200202
val typeId = colType.id
@@ -286,7 +288,7 @@ fun TableScreen(
286288
TableRowDataInternal(
287289
measurementId = enrichedItem.measurementWithValues.measurement.id,
288290
timestamp = ts,
289-
formattedTimestamp = dateFormatterDate.format(Date(ts)) + "\n" + dateFormatterTime.format(Date(ts)),
291+
formattedTimestamp = dateFormatterDate.format(date) + " (" + dateFormatterDayOfWeek.format(date) + ")\n" + dateFormatterTime.format(date),
290292
values = cellValues
291293
)
292294
}

0 commit comments

Comments
 (0)