format timestamp
This commit is contained in:
@@ -52,9 +52,9 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
{required BuildContext context, required String position}) async {
|
||||
DateTime? pickedDate = await showDatePicker(
|
||||
context: context,
|
||||
firstDate: DateTime.now(),
|
||||
initialDate: DateTime.now(),
|
||||
lastDate: DateTime(2026));
|
||||
firstDate: DateTime.fromMicrosecondsSinceEpoch(widget.events["date"]),
|
||||
initialDate: DateTime.fromMicrosecondsSinceEpoch(widget.events["date"]),
|
||||
lastDate: DateTime(2104));
|
||||
if (pickedDate == null) return;
|
||||
if (position == "start") {
|
||||
startDatepicker.text = DateFormat("dd-MM-yyyy").format(pickedDate);
|
||||
@@ -66,8 +66,10 @@ class _UpdateeventImageState extends State<UpdateeventImage>
|
||||
|
||||
onTapFunctionTimePicker(
|
||||
{required BuildContext context, required String position}) async {
|
||||
TimeOfDay? pickedDate =
|
||||
await showTimePicker(context: context, initialTime: TimeOfDay.now());
|
||||
TimeOfDay? pickedDate = await showTimePicker(
|
||||
context: context,
|
||||
initialTime: TimeOfDay.fromDateTime(
|
||||
DateTime.fromMicrosecondsSinceEpoch(widget.events["date"])));
|
||||
if (pickedDate == null) return;
|
||||
if (position == "start") {
|
||||
startTimepicker.text = pickedDate.format(context);
|
||||
|
Reference in New Issue
Block a user