modify clockin & leave
This commit is contained in:
@@ -25,7 +25,7 @@ class ClockInApiService {
|
||||
return await _apiService.fetchList<ClockInRecord>(
|
||||
tableName: "hrs_ClockInRecord",
|
||||
pk: "ClockInId",
|
||||
queryFilter: "1^100^ClockInDateTime^*^^^ClockInUserId^$userId",
|
||||
queryFilter: "1^100^ClockInDateTime^*^ClockInDateTime >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)^^ClockInUserId^$userId",
|
||||
fromJson: (json) => ClockInRecord.fromJson(json),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ class _ClockInManagerState extends State<ClockInManager> {
|
||||
Widget _buildHistoryTile(ClockInRecord record) {
|
||||
return ListTile(
|
||||
leading: Icon(Icons.access_time, color: record.typeColor),
|
||||
title: Text("${record.type} - ${record.formattedTime}"),
|
||||
title: Text("${record.type} - ${record.formattedDateTime}"),
|
||||
subtitle: Text(record.storeId ?? ""),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,10 @@ class ClockInRecord {
|
||||
|
||||
String get formattedTime => dateTime != null ? DateFormat('HH:mm:ss').format(dateTime!) : '--:--';
|
||||
String get formattedDate => dateTime != null ? DateFormat('yyyy-MM-dd').format(dateTime!) : 'N/A';
|
||||
// 新增:滿足列表顯示「日期 + 時間」的需求
|
||||
String get formattedDateTime => dateTime != null
|
||||
? DateFormat('yyyy-MM-dd HH:mm').format(dateTime!)
|
||||
: 'N/A';
|
||||
|
||||
Color get typeColor {
|
||||
if (type == '上班') return Colors.blue;
|
||||
|
||||
Reference in New Issue
Block a user