fix: DateCardCellState date formatting (#3387)

* fix: DateCardCellState date formatting

* refactor: use string interpolation
This commit is contained in:
Vincenzo De Petris 2023-09-13 05:18:07 +02:00 committed by GitHub
parent c7af04b317
commit aa25aa4474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,11 @@ class DateCardCellState with _$DateCardCellState {
String _dateStrFromCellData(DateCellDataPB? cellData) {
String dateStr = "";
if (cellData != null) {
dateStr = "${cellData.date} ${cellData.time}";
if (cellData.includeTime) {
dateStr = '${cellData.date} ${cellData.time}';
} else {
dateStr = cellData.date;
}
}
return dateStr;
}