Implement Asia/Manila Time Zone

Handled saving of Relievers
This commit is contained in:
2026-02-11 20:12:48 +08:00
parent 747edbdd8c
commit 678a73a696
20 changed files with 551 additions and 168 deletions
+7 -3
View File
@@ -2,6 +2,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:supabase_flutter/supabase_flutter.dart';
import 'supabase_provider.dart';
import '../utils/app_time.dart';
final adminUserControllerProvider = Provider<AdminUserController>((ref) {
final client = ref.watch(supabaseClientProvider);
@@ -16,7 +17,7 @@ class AdminUserStatus {
bool get isLocked {
if (bannedUntil == null) return false;
return bannedUntil!.isAfter(DateTime.now().toUtc());
return bannedUntil!.isAfter(AppTime.now());
}
}
@@ -67,11 +68,14 @@ class AdminUserController {
);
final user = (data as Map<String, dynamic>)['user'] as Map<String, dynamic>;
final bannedUntilRaw = user['banned_until'] as String?;
final bannedUntilParsed = bannedUntilRaw == null
? null
: DateTime.tryParse(bannedUntilRaw);
return AdminUserStatus(
email: user['email'] as String?,
bannedUntil: bannedUntilRaw == null
bannedUntil: bannedUntilParsed == null
? null
: DateTime.tryParse(bannedUntilRaw),
: AppTime.toAppTime(bannedUntilParsed),
);
}
+4 -3
View File
@@ -4,6 +4,7 @@ import 'package:supabase_flutter/supabase_flutter.dart';
import '../models/notification_item.dart';
import 'profile_provider.dart';
import 'supabase_provider.dart';
import '../utils/app_time.dart';
final notificationsProvider = StreamProvider<List<NotificationItem>>((ref) {
final userId = ref.watch(currentUserIdProvider);
@@ -69,7 +70,7 @@ class NotificationsController {
Future<void> markRead(String id) async {
await _client
.from('notifications')
.update({'read_at': DateTime.now().toUtc().toIso8601String()})
.update({'read_at': AppTime.nowUtc().toIso8601String()})
.eq('id', id);
}
@@ -78,7 +79,7 @@ class NotificationsController {
if (userId == null) return;
await _client
.from('notifications')
.update({'read_at': DateTime.now().toUtc().toIso8601String()})
.update({'read_at': AppTime.nowUtc().toIso8601String()})
.eq('ticket_id', ticketId)
.eq('user_id', userId)
.filter('read_at', 'is', null);
@@ -89,7 +90,7 @@ class NotificationsController {
if (userId == null) return;
await _client
.from('notifications')
.update({'read_at': DateTime.now().toUtc().toIso8601String()})
.update({'read_at': AppTime.nowUtc().toIso8601String()})
.eq('task_id', taskId)
.eq('user_id', userId)
.filter('read_at', 'is', null);