|
|
@@ -71,7 +71,6 @@ class PersonalRankController extends GetxController {
|
|
|
class PersonalRankPage extends StatelessWidget {
|
|
|
PersonalRankPage({super.key});
|
|
|
|
|
|
- final dateFmt = DateFormat('yyyy-MM-dd');
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
@@ -103,18 +102,23 @@ class PersonalRankPage extends StatelessWidget {
|
|
|
}
|
|
|
|
|
|
Future<void> _pickDate(BuildContext context, PersonalRankController c) async {
|
|
|
- final now = DateTime.now();
|
|
|
-
|
|
|
- final date = await showDatePicker(
|
|
|
- context: context,
|
|
|
- initialDate: c.filterStartAt.value,
|
|
|
- firstDate: DateTime(now.year - 1),
|
|
|
- lastDate: DateTime(now.year, now.month, now.day + 1),
|
|
|
- );
|
|
|
+ final now = c.filterStartAt.value;
|
|
|
+ final time = await showTimePicker(context: context, initialTime: TimeOfDay.fromDateTime(now));
|
|
|
|
|
|
- if (date != null) {
|
|
|
- c.filterStartAt.value = DateTime(date.year, date.month, date.day);
|
|
|
+ if (time!= null){
|
|
|
+ c.filterStartAt.value = DateTime(now.year, now.month, now.day, time.hour, time.minute);
|
|
|
+ info('time: ${c.filterStartAt.value}');
|
|
|
}
|
|
|
+ // final date = await showDatePicker(
|
|
|
+ // context: context,
|
|
|
+ // initialDate: c.filterStartAt.value,
|
|
|
+ // firstDate: DateTime(now.year - 1),
|
|
|
+ // lastDate: DateTime(now.year, now.month, now.day + 1),
|
|
|
+ // );
|
|
|
+ //
|
|
|
+ // if (date != null) {
|
|
|
+ // c.filterStartAt.value = DateTime(date.year, date.month, date.day);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
Widget titlePoint() {
|
|
|
@@ -136,7 +140,7 @@ class PersonalRankPage extends StatelessWidget {
|
|
|
border: Border.all(color: const Color(0xffe3e3e3))),
|
|
|
child: TextButton(
|
|
|
onPressed: () => _pickDate(context, c),
|
|
|
- child: Text(dateFmt.format(c.filterStartAt.value))),
|
|
|
+ child: Text(TimeOfDay.fromDateTime(c.filterStartAt.value).format(context)))
|
|
|
)
|
|
|
],
|
|
|
),
|