Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/core/network/auth_notifier.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions lib/core/widgets/dashboard/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ class _DashboardCalendarWidgetState extends riverpod.ConsumerState<DashboardCale
}

for (final session in sessions) {
final date = DateFormatLists.format(session.date);
final date = DateFormatLists.format(session.localDay);
events.putIfAbsent(date, () => []);
var time = '';
if (session.timeStart != null && session.timeEnd != null) {
time = '(${timeToString(session.timeStart)} - ${timeToString(session.timeEnd)})';
if (session.datetimeEnd != null) {
time =
'(${timeToString(TimeOfDay.fromDateTime(session.datetimeStart))} - ${timeToString(TimeOfDay.fromDateTime(session.datetimeEnd!))})';
}
events[date]!.add(
Event(
Expand Down
15 changes: 15 additions & 0 deletions lib/database/converters/date_only_text_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,18 @@ class DateOnlyTextConverter extends TypeConverter<DateTime, String> {
'${value.month.toString().padLeft(2, '0')}-'
'${value.day.toString().padLeft(2, '0')}';
}

/// Stores a moment as UTC ISO8601, the same wire format the server speaks.
///
/// Keeping every row in UTC with an identical layout means a plain string
/// comparison on the column is also a comparison in time, which the session
/// lookup in the log repository relies on.
class DateTimeTextConverter extends TypeConverter<DateTime, String> {
const DateTimeTextConverter();

@override
DateTime fromSql(String fromDb) => DateTime.parse(fromDb).toLocal();

@override
String toSql(DateTime value) => value.toUtc().toIso8601String();
}
Loading
Loading