fix ai date

This commit is contained in:
2024-08-18 19:14:01 +02:00
parent da57be9608
commit 218504c9df
3 changed files with 54 additions and 60 deletions

View File

@@ -52,8 +52,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
{required BuildContext context, required String position}) async {
DateTime? pickedDate = await showDatePicker(
context: context,
firstDate: DateTime.fromMicrosecondsSinceEpoch(widget.events["date"]),
initialDate: DateTime.fromMicrosecondsSinceEpoch(widget.events["date"]),
firstDate:
DateTime.fromMicrosecondsSinceEpoch(widget.events["timestamp"]),
initialDate:
DateTime.fromMicrosecondsSinceEpoch(widget.events["timestamp"]),
lastDate: DateTime(2104));
if (pickedDate == null) return;
if (position == "start") {
@@ -163,13 +165,13 @@ class _UpdateeventImageState extends State<UpdateeventImage>
void start() async {
inputName.text = widget.events["name"];
inputPlace.text = widget.events["place"];
print(widget.events["timestamp"]);
DateTime pickedDate =
DateTime.fromMicrosecondsSinceEpoch(widget.events["date"]);
DateTime.fromMicrosecondsSinceEpoch(widget.events["timestamp"]);
startDatepicker.text = DateFormat("dd-MM-yyyy").format(pickedDate);
endDatepicker.text = DateFormat("dd-MM-yyyy").format(pickedDate);
TimeOfDay pickedTime = TimeOfDay.fromDateTime(pickedDate);
startTimepicker.text = pickedTime.format(context);
endTimepicker.text = pickedTime.format(context);
startTimepicker.text = DateFormat("HH-mm").format(pickedDate);
endTimepicker.text = DateFormat("HH-mm").format(pickedDate);
}
@override