Skip to content

Commit

Permalink
Fixed date/time export for Excel CSV import
Browse files Browse the repository at this point in the history
  • Loading branch information
Futsch1 committed Feb 18, 2024
1 parent dc14470 commit e6f18d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/com/futsch1/medtimer/CSVCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void create(File file) throws IOException {
for (ReminderEvent reminderEvent : reminderEvents) {
Instant remindedTime = Instant.ofEpochSecond(reminderEvent.remindedTimestamp);
ZonedDateTime zonedDateTime = remindedTime.atZone(TimeZone.getDefault().toZoneId());
csvFile.write(String.format("%s;", zonedDateTime.format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT))));
csvFile.write(String.format("%s %s;",
zonedDateTime.format(DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT)),
zonedDateTime.format(DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT))));
csvFile.write(String.format("%s;", reminderEvent.medicineName));
csvFile.write(String.format("%s;", reminderEvent.amount));
csvFile.write(String.format("%s\n", reminderEvent.status == ReminderEvent.ReminderStatus.TAKEN ? "x" : ""));
Expand Down

0 comments on commit e6f18d4

Please sign in to comment.